sandbox
Loading...
Searching...
No Matches
angle.hpp File Reference

Angle types and utilities. More...

#include <cmath>
#include <concepts>
#include <numbers>
#include <libsbx/math/concepts.hpp>
#include <libsbx/math/smooth_value.hpp>
#include <libsbx/math/angle.ipp>

Go to the source code of this file.

Classes

class  sbx::math::basic_degree< Type >
 Strongly-typed degree value wrapper. More...
 
struct  sbx::math::is_smoothable< basic_degree< Type > >
 Marks degrees as smoothable for smoothing/interpolation utilities. More...
 
struct  sbx::math::comparision_traits< basic_degree< Type > >
 Comparison traits specialization for degree values. More...
 
class  sbx::math::basic_radian< Type >
 Strongly-typed radian value wrapper. More...
 
class  sbx::math::basic_angle< Type >
 Unified angle type stored internally in radians. More...
 

Namespaces

namespace  libsbx
 
namespace  sbx::math::literals
 User-defined literals for degree and radian values.
 

Typedefs

using sbx::math::degree = basic_degree< std::float_t >
 Default degree type using std::float_t.
 
using sbx::math::radian = basic_radian< std::float_t >
 Default radian type using std::float_t.
 
using sbx::math::angle = basic_angle< std::float_t >
 Default angle type using std::float_t.
 

Functions

template<floating_point Type>
constexpr auto sbx::math::operator== (const basic_degree< Type > &lhs, const basic_degree< Type > &rhs) noexcept -> bool
 Equality comparison for degrees. More...
 
template<floating_point Type, floating_point Other>
constexpr auto sbx::math::operator<=> (const basic_degree< Type > &lhs, const basic_degree< Other > &rhs) noexcept -> std::partial_ordering
 Partial ordering comparison for degrees. More...
 
template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator+ (basic_degree< Type > lhs, const basic_degree< Other > &rhs) noexcept -> basic_degree< Type >
 Adds two degree values. More...
 
template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator- (basic_degree< Type > lhs, const basic_degree< Other > &rhs) noexcept -> basic_degree< Type >
 Subtracts two degree values. More...
 
template<floating_point Type, std::convertible_to< Type > Other>
constexpr auto sbx::math::operator* (basic_degree< Type > lhs, const Other rhs) noexcept -> basic_degree< Type >
 Multiplies a degree value by a scalar factor. More...
 
template<floating_point Type, std::convertible_to< Type > Other>
constexpr auto sbx::math::operator/ (basic_degree< Type > lhs, const Other rhs) noexcept -> basic_degree< Type >
 Divides a degree value by a scalar factor. More...
 
template<floating_point Type>
constexpr auto sbx::math::clamp (const basic_degree< Type > &value, const basic_degree< Type > &min, const basic_degree< Type > &max) -> const basic_degree< Type > &
 Clamps a degree value to a closed interval. More...
 
template<floating_point Type>
constexpr auto sbx::math::mix (const basic_degree< Type > x, const basic_degree< Type > y, const Type a) -> basic_degree< Type >
 Linearly interpolates between two degree values. More...
 
template<floating_point Type>
constexpr auto sbx::math::operator== (const basic_radian< Type > &lhs, const basic_radian< Type > &rhs) noexcept -> bool
 Equality comparison for radians. More...
 
template<floating_point Type, floating_point Other>
constexpr auto sbx::math::operator<=> (const basic_radian< Type > &lhs, const basic_radian< Other > &rhs) noexcept -> std::partial_ordering
 Partial ordering comparison for radians. More...
 
template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator+ (basic_radian< Type > lhs, const basic_radian< Other > &rhs) noexcept -> basic_radian< Type >
 Adds two radian values. More...
 
template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator- (basic_radian< Type > lhs, const basic_radian< Other > &rhs) noexcept -> basic_radian< Type >
 Subtracts two radian values. More...
 
template<floating_point Type, std::convertible_to< Type > Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator* (basic_radian< Type > lhs, const Other rhs) noexcept -> basic_radian< Type >
 Multiplies a radian value by a scalar factor. More...
 
template<floating_point Type>
constexpr auto sbx::math::clamp (const basic_radian< Type > &value, const basic_radian< Type > &min, const basic_radian< Type > &max) -> const basic_radian< Type > &
 Clamps a radian value to a closed interval. More...
 
template<floating_point Type>
constexpr auto sbx::math::operator== (const basic_angle< Type > &lhs, const basic_angle< Type > &rhs) noexcept -> bool
 Equality comparison for angles. More...
 
template<floating_point Type, floating_point Other>
constexpr auto sbx::math::operator<=> (const basic_angle< Type > &lhs, const basic_angle< Other > &rhs) noexcept -> std::partial_ordering
 Partial ordering comparison for angles. More...
 
template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator+ (basic_angle< LhsType > lhs, const basic_angle< RhsType > &rhs) noexcept -> basic_angle< LhsType >
 Adds two angles. More...
 
template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator+ (basic_angle< LhsType > lhs, const basic_degree< RhsType > &rhs) noexcept -> basic_angle< LhsType >
 Adds an angle and a degree value. More...
 
template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator+ (basic_angle< LhsType > lhs, const basic_radian< RhsType > &rhs) noexcept -> basic_angle< LhsType >
 Adds an angle and a radian value. More...
 
template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator- (basic_angle< LhsType > lhs, const basic_angle< RhsType > &rhs) noexcept -> basic_angle< LhsType >
 Subtracts two angles. More...
 
template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator- (basic_angle< LhsType > lhs, const basic_degree< RhsType > &rhs) noexcept -> basic_angle< LhsType >
 Subtracts a degree value from an angle. More...
 
template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator- (basic_angle< LhsType > lhs, const basic_radian< RhsType > &rhs) noexcept -> basic_angle< LhsType >
 Subtracts a radian value from an angle. More...
 
template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator* (basic_angle< LhsType > lhs, const RhsType rhs) noexcept -> basic_angle< LhsType >
 Scales an angle by a scalar factor. More...
 
template<floating_point Type>
constexpr auto sbx::math::clamp (const basic_angle< Type > &value, const basic_angle< Type > &min, const basic_angle< Type > &max) -> const basic_angle< Type > &
 Clamps an angle value to a closed interval. More...
 
template<floating_point Type>
constexpr auto sbx::math::to_degrees (const basic_radian< Type > &radian) noexcept -> basic_degree< Type >
 Converts radians to degrees. More...
 
template<floating_point Type>
constexpr auto sbx::math::to_radians (const basic_degree< Type > &degree) noexcept -> basic_radian< Type >
 Converts degrees to radians. More...
 
template<floating_point Type>
constexpr auto sbx::math::sin (const basic_angle< Type > &angle) noexcept -> Type
 Computes the sine of an angle. More...
 
template<floating_point Type>
constexpr auto sbx::math::sin (const basic_degree< Type > &degree) noexcept -> Type
 Computes the sine of a degree value. More...
 
template<floating_point Type>
constexpr auto sbx::math::sin (const basic_radian< Type > &radian) noexcept -> Type
 Computes the sine of a radian value. More...
 
template<floating_point Type>
constexpr auto sbx::math::cos (const basic_angle< Type > &angle) noexcept -> Type
 Computes the cosine of an angle. More...
 
template<floating_point Type>
constexpr auto sbx::math::cos (const basic_degree< Type > &degree) noexcept -> Type
 Computes the cosine of a degree value. More...
 
template<floating_point Type>
constexpr auto sbx::math::cos (const basic_radian< Type > &radian) noexcept -> Type
 Computes the cosine of a radian value. More...
 
template<floating_point Type>
constexpr auto sbx::math::tan (const basic_angle< Type > &angle) noexcept -> Type
 Computes the tangent of an angle. More...
 
constexpr auto sbx::math::literals::operator""_deg (long double value) noexcept -> degree
 Creates a degree value from a long double literal. More...
 
constexpr auto sbx::math::literals::operator""_deg (unsigned long long value) noexcept -> degree
 Creates a degree value from an unsigned integer literal. More...
 
constexpr auto sbx::math::literals::operator""_rad (long double value) noexcept -> radian
 Creates a radian value from a long double literal. More...
 
constexpr auto sbx::math::literals::operator""_rad (unsigned long long value) noexcept -> radian
 Creates a radian value from an unsigned integer literal. More...
 

Detailed Description

Angle types and utilities.

This header defines strongly-typed wrappers for angular quantities in degrees and radians, plus a unified angle type that stores angles internally in radians.

The provided types are lightweight value wrappers intended to prevent unit-mismatch bugs, while remaining usable in constexpr contexts where possible.

Author
KAJ

Function Documentation

◆ clamp() [1/3]

template<floating_point Type>
constexpr auto sbx::math::clamp ( const basic_angle< Type > &  value,
const basic_angle< Type > &  min,
const basic_angle< Type > &  max 
) -> const basic_angle<Type>&
constexpr

Clamps an angle value to a closed interval.

Template Parameters
TypeFloating-point storage type.
Parameters
valueValue to clamp.
minLower bound (inclusive).
maxUpper bound (inclusive).
Returns
Reference to the clamped value (one of value, min, or max).

◆ clamp() [2/3]

template<floating_point Type>
constexpr auto sbx::math::clamp ( const basic_degree< Type > &  value,
const basic_degree< Type > &  min,
const basic_degree< Type > &  max 
) -> const basic_degree<Type>&
constexpr

Clamps a degree value to a closed interval.

Template Parameters
TypeFloating-point storage type.
Parameters
valueValue to clamp.
minLower bound (inclusive).
maxUpper bound (inclusive).
Returns
Reference to the clamped value (one of value, min, or max).

◆ clamp() [3/3]

template<floating_point Type>
constexpr auto sbx::math::clamp ( const basic_radian< Type > &  value,
const basic_radian< Type > &  min,
const basic_radian< Type > &  max 
) -> const basic_radian<Type>&
constexpr

Clamps a radian value to a closed interval.

Template Parameters
TypeFloating-point storage type.
Parameters
valueValue to clamp.
minLower bound (inclusive).
maxUpper bound (inclusive).
Returns
Reference to the clamped value (one of value, min, or max).

◆ cos() [1/3]

template<floating_point Type>
constexpr auto sbx::math::cos ( const basic_angle< Type > &  angle) -> Type
constexprnoexcept

Computes the cosine of an angle.

Template Parameters
TypeFloating-point storage type.
Parameters
angleAngle to evaluate.
Returns
Cosine of the angle.

◆ cos() [2/3]

template<floating_point Type>
constexpr auto sbx::math::cos ( const basic_degree< Type > &  degree) -> Type
constexprnoexcept

Computes the cosine of a degree value.

Template Parameters
TypeFloating-point storage type.
Parameters
degreeDegree value to evaluate.
Returns
Cosine of the angle.

◆ cos() [3/3]

template<floating_point Type>
constexpr auto sbx::math::cos ( const basic_radian< Type > &  radian) -> Type
constexprnoexcept

Computes the cosine of a radian value.

Template Parameters
TypeFloating-point storage type.
Parameters
radianRadian value to evaluate.
Returns
Cosine of the angle.

◆ mix()

template<floating_point Type>
constexpr auto sbx::math::mix ( const basic_degree< Type >  x,
const basic_degree< Type >  y,
const Type  a 
) -> basic_degree<Type>
inlineconstexpr

Linearly interpolates between two degree values.

Template Parameters
TypeFloating-point storage type.
Parameters
xStart value.
yEnd value.
aInterpolation factor in [0, 1] (not enforced).
Returns
Interpolated degree value.

◆ operator*() [1/3]

template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator* ( basic_angle< LhsType >  lhs,
const RhsType  rhs 
) -> basic_angle<LhsType>
constexprnoexcept

Scales an angle by a scalar factor.

Template Parameters
LhsTypeFloating-point storage type of the angle.
RhsTypeFloating-point type of the scalar factor.
Parameters
lhsAngle value.
rhsScale factor.
Returns
Scaled angle.

◆ operator*() [2/3]

template<floating_point Type, std::convertible_to< Type > Other>
constexpr auto sbx::math::operator* ( basic_degree< Type >  lhs,
const Other  rhs 
) -> basic_degree<Type>
constexprnoexcept

Multiplies a degree value by a scalar factor.

Template Parameters
TypeFloating-point storage type.
OtherScalar type convertible to Type.
Parameters
lhsDegree value.
rhsScale factor.
Returns
Scaled degree value.

◆ operator*() [3/3]

template<floating_point Type, std::convertible_to< Type > Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator* ( basic_radian< Type >  lhs,
const Other  rhs 
) -> basic_radian<Type>
constexprnoexcept

Multiplies a radian value by a scalar factor.

Template Parameters
TypeFloating-point storage type.
OtherScalar type convertible to Type.
Parameters
lhsRadian value.
rhsScale factor.
Returns
Scaled radian value.

◆ operator+() [1/5]

template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator+ ( basic_angle< LhsType >  lhs,
const basic_angle< RhsType > &  rhs 
) -> basic_angle<LhsType>
constexprnoexcept

Adds two angles.

Template Parameters
LhsTypeFloating-point storage type of the left operand.
RhsTypeFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Sum of both operands.

◆ operator+() [2/5]

template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator+ ( basic_angle< LhsType >  lhs,
const basic_degree< RhsType > &  rhs 
) -> basic_angle<LhsType>
constexprnoexcept

Adds an angle and a degree value.

Template Parameters
LhsTypeFloating-point storage type of the left operand.
RhsTypeFloating-point storage type of the degree operand.
Parameters
lhsLeft-hand side angle.
rhsDegree value.
Returns
Sum as an angle.

◆ operator+() [3/5]

template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator+ ( basic_angle< LhsType >  lhs,
const basic_radian< RhsType > &  rhs 
) -> basic_angle<LhsType>
constexprnoexcept

Adds an angle and a radian value.

Template Parameters
LhsTypeFloating-point storage type of the left operand.
RhsTypeFloating-point storage type of the radian operand.
Parameters
lhsLeft-hand side angle.
rhsRadian value.
Returns
Sum as an angle.

◆ operator+() [4/5]

template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator+ ( basic_degree< Type >  lhs,
const basic_degree< Other > &  rhs 
) -> basic_degree<Type>
constexprnoexcept

Adds two degree values.

Template Parameters
TypeFloating-point storage type of the left operand.
OtherFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Sum of both operands.

◆ operator+() [5/5]

template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator+ ( basic_radian< Type >  lhs,
const basic_radian< Other > &  rhs 
) -> basic_radian<Type>
constexprnoexcept

Adds two radian values.

Template Parameters
TypeFloating-point storage type of the left operand.
OtherFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Sum of both operands.

◆ operator-() [1/5]

template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator- ( basic_angle< LhsType >  lhs,
const basic_angle< RhsType > &  rhs 
) -> basic_angle<LhsType>
constexprnoexcept

Subtracts two angles.

Template Parameters
LhsTypeFloating-point storage type of the left operand.
RhsTypeFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Difference of both operands.

◆ operator-() [2/5]

template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator- ( basic_angle< LhsType >  lhs,
const basic_degree< RhsType > &  rhs 
) -> basic_angle<LhsType>
constexprnoexcept

Subtracts a degree value from an angle.

Template Parameters
LhsTypeFloating-point storage type of the left operand.
RhsTypeFloating-point storage type of the degree operand.
Parameters
lhsLeft-hand side angle.
rhsDegree value.
Returns
Difference as an angle.

◆ operator-() [3/5]

template<floating_point LhsType, floating_point RhsType>
requires (std::is_convertible_v<RhsType, LhsType>)
constexpr auto sbx::math::operator- ( basic_angle< LhsType >  lhs,
const basic_radian< RhsType > &  rhs 
) -> basic_angle<LhsType>
constexprnoexcept

Subtracts a radian value from an angle.

Template Parameters
LhsTypeFloating-point storage type of the left operand.
RhsTypeFloating-point storage type of the radian operand.
Parameters
lhsLeft-hand side angle.
rhsRadian value.
Returns
Difference as an angle.

◆ operator-() [4/5]

template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator- ( basic_degree< Type >  lhs,
const basic_degree< Other > &  rhs 
) -> basic_degree<Type>
constexprnoexcept

Subtracts two degree values.

Template Parameters
TypeFloating-point storage type of the left operand.
OtherFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Difference of both operands.

◆ operator-() [5/5]

template<floating_point Type, floating_point Other>
requires (std::is_convertible_v<Other, Type>)
constexpr auto sbx::math::operator- ( basic_radian< Type >  lhs,
const basic_radian< Other > &  rhs 
) -> basic_radian<Type>
constexprnoexcept

Subtracts two radian values.

Template Parameters
TypeFloating-point storage type of the left operand.
OtherFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Difference of both operands.

◆ operator/()

template<floating_point Type, std::convertible_to< Type > Other>
constexpr auto sbx::math::operator/ ( basic_degree< Type >  lhs,
const Other  rhs 
) -> basic_degree<Type>
constexprnoexcept

Divides a degree value by a scalar factor.

Template Parameters
TypeFloating-point storage type.
OtherScalar type convertible to Type.
Parameters
lhsDegree value.
rhsDivisor.
Returns
Scaled degree value.

◆ operator<=>() [1/3]

template<floating_point Type, floating_point Other>
constexpr auto sbx::math::operator<=> ( const basic_angle< Type > &  lhs,
const basic_angle< Other > &  rhs 
) -> std::partial_ordering
constexprnoexcept

Partial ordering comparison for angles.

Template Parameters
TypeFloating-point storage type of the left operand.
OtherFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Partial ordering result of the radian values.

◆ operator<=>() [2/3]

template<floating_point Type, floating_point Other>
constexpr auto sbx::math::operator<=> ( const basic_degree< Type > &  lhs,
const basic_degree< Other > &  rhs 
) -> std::partial_ordering
constexprnoexcept

Partial ordering comparison for degrees.

Template Parameters
TypeFloating-point storage type of the left operand.
OtherFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Partial ordering result of the underlying values.

◆ operator<=>() [3/3]

template<floating_point Type, floating_point Other>
constexpr auto sbx::math::operator<=> ( const basic_radian< Type > &  lhs,
const basic_radian< Other > &  rhs 
) -> std::partial_ordering
constexprnoexcept

Partial ordering comparison for radians.

Template Parameters
TypeFloating-point storage type of the left operand.
OtherFloating-point storage type of the right operand.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
Partial ordering result of the underlying values.

◆ operator==() [1/3]

template<floating_point Type>
constexpr auto sbx::math::operator== ( const basic_angle< Type > &  lhs,
const basic_angle< Type > &  rhs 
) -> bool
constexprnoexcept

Equality comparison for angles.

Template Parameters
TypeFloating-point storage type.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
True if the angles compare equal in radians.

◆ operator==() [2/3]

template<floating_point Type>
constexpr auto sbx::math::operator== ( const basic_degree< Type > &  lhs,
const basic_degree< Type > &  rhs 
) -> bool
constexprnoexcept

Equality comparison for degrees.

Template Parameters
TypeFloating-point storage type.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
True if the underlying values compare equal.

◆ operator==() [3/3]

template<floating_point Type>
constexpr auto sbx::math::operator== ( const basic_radian< Type > &  lhs,
const basic_radian< Type > &  rhs 
) -> bool
constexprnoexcept

Equality comparison for radians.

Template Parameters
TypeFloating-point storage type.
Parameters
lhsLeft-hand side operand.
rhsRight-hand side operand.
Returns
True if the underlying values compare equal.

◆ sin() [1/3]

template<floating_point Type>
constexpr auto sbx::math::sin ( const basic_angle< Type > &  angle) -> Type
constexprnoexcept

Computes the sine of an angle.

Template Parameters
TypeFloating-point storage type.
Parameters
angleAngle to evaluate.
Returns
Sine of the angle.

◆ sin() [2/3]

template<floating_point Type>
constexpr auto sbx::math::sin ( const basic_degree< Type > &  degree) -> Type
constexprnoexcept

Computes the sine of a degree value.

Template Parameters
TypeFloating-point storage type.
Parameters
degreeDegree value to evaluate.
Returns
Sine of the angle.

◆ sin() [3/3]

template<floating_point Type>
constexpr auto sbx::math::sin ( const basic_radian< Type > &  radian) -> Type
constexprnoexcept

Computes the sine of a radian value.

Template Parameters
TypeFloating-point storage type.
Parameters
radianRadian value to evaluate.
Returns
Sine of the angle.

◆ tan()

template<floating_point Type>
constexpr auto sbx::math::tan ( const basic_angle< Type > &  angle) -> Type
constexprnoexcept

Computes the tangent of an angle.

Template Parameters
TypeFloating-point storage type.
Parameters
angleAngle to evaluate.
Returns
Tangent of the angle.

◆ to_degrees()

template<floating_point Type>
constexpr auto sbx::math::to_degrees ( const basic_radian< Type > &  radian) -> basic_degree<Type>
constexprnoexcept

Converts radians to degrees.

Template Parameters
TypeFloating-point storage type.
Parameters
radianRadian value to convert.
Returns
Degree equivalent.

◆ to_radians()

template<floating_point Type>
constexpr auto sbx::math::to_radians ( const basic_degree< Type > &  degree) -> basic_radian<Type>
constexprnoexcept

Converts degrees to radians.

Template Parameters
TypeFloating-point storage type.
Parameters
degreeDegree value to convert.
Returns
Radian equivalent.