Skip to content

Commit

Permalink
remove reference to Number in Angle.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
SizzinSeal committed Jan 7, 2025
1 parent 265a8f0 commit 107cc67
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions include/units/Angle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ constexpr CAngle operator""_cRot(unsigned long long value) {

// Angle functions
namespace units {
constexpr Number sin(const Angle& rhs) { return Number(std::sin(rhs.internal())); }
constexpr double sin(const Angle& rhs) { return std::sin(rhs.internal()); }

constexpr Number cos(const Angle& rhs) { return Number(std::cos(rhs.internal())); }
constexpr double cos(const Angle& rhs) { return std::cos(rhs.internal()); }

constexpr Number tan(const Angle& rhs) { return Number(std::tan(rhs.internal())); }
constexpr double tan(const Angle& rhs) { return std::tan(rhs.internal()); }

template <isQuantity Q> constexpr Angle asin(const Q& rhs) { return Angle(std::asin(rhs.internal())); }

Expand All @@ -170,27 +170,27 @@ static inline Angle constrainAngle180(Angle in) {

// Angle to/from operators
// Standard orientation
constexpr inline Angle from_stRad(Number value) { return Angle(value.internal()); }
constexpr Angle from_stRad(double value) { return Angle(value); }

constexpr inline double to_stRad(Angle quantity) { return quantity.internal(); }
constexpr double to_stRad(Angle quantity) { return quantity.internal(); }

constexpr inline Angle from_stDeg(Number value) { return value * deg; }
constexpr Angle from_stDeg(double value) { return value * deg; }

constexpr inline double to_stDeg(Angle quantity) { return quantity.convert(deg); }
constexpr double to_stDeg(Angle quantity) { return quantity.convert(deg); }

constexpr inline Angle from_stRot(Number value) { return value * rot; }
constexpr Angle from_stRot(double value) { return value * rot; }

constexpr inline double to_stRot(Angle quantity) { return quantity.convert(rot); }
constexpr double to_stRot(Angle quantity) { return quantity.convert(rot); }

// Compass orientation
constexpr inline Angle from_cRad(Number value) { return 90 * deg - Angle(value.internal()); }
constexpr Angle from_cRad(double value) { return 90.0 * deg - Angle(value); }

constexpr inline double to_cRad(Angle quantity) { return quantity.internal(); }
constexpr double to_cRad(Angle quantity) { return quantity.internal(); }

constexpr inline Angle from_cDeg(Number value) { return (90 - value.internal()) * deg; }
constexpr Angle from_cDeg(double value) { return (90.0 - value) * deg; }

constexpr inline double to_cDeg(Angle quantity) { return (90 * deg - quantity).convert(deg); }
constexpr double to_cDeg(Angle quantity) { return (90.0 * deg - quantity).convert(deg); }

constexpr inline Angle from_cRot(Number value) { return (90 - value.internal()) * deg; }
constexpr Angle from_cRot(double value) { return (90.0 - value) * deg; }

constexpr inline double to_cRot(Angle quantity) { return (90 * deg - quantity).convert(rot); }
constexpr double to_cRot(Angle quantity) { return (90.0 * deg - quantity).convert(rot); }

0 comments on commit 107cc67

Please sign in to comment.