#ifndef __SCOP_ANGLES__ #define __SCOP_ANGLES__ #include #include #include namespace Scop { template struct EulerAngles; template struct Quat; template struct Angle { T value; constexpr Angle() = default; constexpr Angle(T angle); template constexpr explicit Angle(const Angle& Angle); template constexpr Angle(const Angle& angle); constexpr Angle(const Angle&) = default; constexpr Angle(Angle&&) noexcept = default; ~Angle() = default; constexpr bool ApproxEqual(const Angle& angle) const; constexpr bool ApproxEqual(const Angle& angle, T max_difference) const; T GetCos() const; T GetSin() const; std::pair GetSinCos() const; T GetTan() const; constexpr Angle& Normalize(); template T To() const; template Angle ToAngle() const; constexpr T ToDegrees() const; constexpr Angle ToDegreeAngle() const; EulerAngles ToEulerAngles() const; Quat ToQuat() const; constexpr T ToRadians() const; constexpr Angle ToRadianAngle() const; std::string ToString() const; constexpr T ToTurns() const; constexpr Angle ToTurnAngle() const; constexpr Angle& operator=(const Angle&) = default; constexpr Angle& operator=(Angle&&) noexcept = default; constexpr Angle operator+() const; constexpr Angle operator-() const; constexpr Angle operator+(Angle other) const; constexpr Angle operator-(Angle other) const; constexpr Angle operator*(T scalar) const; constexpr Angle operator/(T divider) const; constexpr Angle& operator+=(Angle other); constexpr Angle& operator-=(Angle other); constexpr Angle& operator*=(T scalar); constexpr Angle& operator/=(T divider); 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 max_difference); static constexpr Angle Clamp(Angle angle, Angle min, Angle max); template static constexpr Angle From(T value); static constexpr Angle FromDegrees(T degrees); static constexpr Angle FromRadians(T radians); static constexpr Angle FromTurns(T turn); static constexpr Angle Zero(); }; template using DegreeAngle = Angle; using DegreeAngled = DegreeAngle; using DegreeAnglef = DegreeAngle; template using RadianAngle = Angle; using RadianAngled = RadianAngle; using RadianAnglef = RadianAngle; template using TurnAngle = Angle; using TurnAngled = TurnAngle; using TurnAnglef = TurnAngle; template Angle operator*(T scale, Angle angle); template Angle operator/(T divider, Angle angle); template std::ostream& operator<<(std::ostream& out, Angle angle); } #include #endif