Improve math module (#396)
* Improve math module - Mark almost everything constexpr - Equality (a == b) is now exact, down to the bit level. If you want approximate equality use the new ApproxEqual method/static method - Rename Nz::Extend to Nz::Extent - Removed Make[] and Set[] methods in favor of their static counterpart and operator=
This commit is contained in:
@@ -34,18 +34,16 @@ namespace Nz
|
||||
constexpr Angle(Angle&&) noexcept = default;
|
||||
~Angle() = default;
|
||||
|
||||
constexpr bool ApproxEqual(const Angle& angle) const;
|
||||
constexpr bool ApproxEqual(const Angle& angle, T maxDifference) const;
|
||||
|
||||
T GetCos() const;
|
||||
T GetSin() const;
|
||||
std::pair<T, T> GetSinCos() const;
|
||||
T GetTan() const;
|
||||
|
||||
constexpr Angle& MakeZero();
|
||||
|
||||
constexpr Angle& Normalize();
|
||||
|
||||
constexpr Angle& Set(Angle ang);
|
||||
template<typename U> constexpr Angle& Set(const Angle<Unit, U>& ang);
|
||||
|
||||
template<AngleUnit ToUnit> T To() const;
|
||||
template<AngleUnit ToUnit> Angle<ToUnit, T> ToAngle() const;
|
||||
constexpr T ToDegrees() const;
|
||||
@@ -76,7 +74,13 @@ namespace Nz
|
||||
|
||||
constexpr bool operator==(Angle other) const;
|
||||
constexpr bool operator!=(Angle other) const;
|
||||
constexpr bool operator<(Angle other) const;
|
||||
constexpr bool operator<=(Angle other) const;
|
||||
constexpr bool operator>(Angle other) const;
|
||||
constexpr bool operator>=(Angle other) const;
|
||||
|
||||
static constexpr bool ApproxEqual(const Angle& lhs, const Angle& rhs);
|
||||
static constexpr bool ApproxEqual(const Angle& lhs, const Angle& rhs, T maxDifference);
|
||||
template<AngleUnit FromUnit> static constexpr Angle From(T value);
|
||||
static constexpr Angle FromDegrees(T degrees);
|
||||
static constexpr Angle FromRadians(T radians);
|
||||
|
||||
Reference in New Issue
Block a user