Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Math Namespace Reference

Namespaces

namespace  Internal
 
namespace  SIMD
 

Classes

class  AffineTransformation
 
class  CompensatedFloat
 
class  CompensatedSum
 
struct  Constants
 
struct  Constants< double >
 
struct  Constants< float >
 
class  Half
 
class  Interval
 
struct  Line
 An infinite line passing through origin<c> with direction given by the unit vector direction<c>. More...
 
struct  LineSimd
 An infinite line passing through origin<c> with direction given by the unit vector direction<c>. More...
 
class  Normal
 
class  Normal< float, 3 >
 
class  Plane
 
class  PlaneSimd
 
class  Point
 
class  Point< float, 2 >
 
class  Point< float, 3 >
 
class  Point< Int32, 2 >
 
class  Point< Int32, 3 >
 
class  Quaternion
 
class  QuaternionSimd
 
class  Scalar
 
class  Scalar< double, 2 >
 
class  Scalar< double, 3 >
 
class  Scalar< double, 4 >
 
class  Scalar< float, 2 >
 
class  Scalar< float, 3 >
 
class  Scalar< float, 4 >
 
struct  Segment
 
struct  SegmentSimd
 
class  SquareMatrix
 
struct  SquareMatrixSimd
 
struct  SquareMatrixSimd< MatrixT, 1 >
 
struct  SquareMatrixSimd< MatrixT, 2 >
 
struct  SquareMatrixSimd< MatrixT, 3 >
 
struct  SquareMatrixSimd< MatrixT, 4 >
 
class  Tuple2
 A tuple holding two numbers. More...
 
class  Tuple3
 
class  Tuple4
 
class  TupleSimd
 
class  Vector
 
class  Vector< double, 2 >
 
class  Vector< double, 3 >
 
class  Vector< double, 4 >
 
class  Vector< float, 2 >
 
class  Vector< float, 3 >
 
class  Vector< float, 4 >
 
class  Vector< Int32, 2 >
 
class  Vector< Int32, 3 >
 
class  Vector< Int32, 4 >
 
class  Vector< UInt32, 2 >
 
class  Vector< UInt32, 3 >
 
class  Vector< UInt32, 4 >
 

Concepts

concept  VectorType
 
concept  VectorSimdType
 
concept  VectorOrVectorSimdType
 
concept  ScalarType
 
concept  ScalarSimdType
 
concept  ScalarOrScalarSimdType
 
concept  SimdType
 
concept  TupleType
 
concept  SimdOrTupleType
 
concept  SimdTupleOrArithmeticType
 
concept  PointType
 
concept  PointSimdType
 
concept  PointOrPointSimdType
 
concept  NormalType
 
concept  NormalSimdType
 
concept  NormalOrNormalSimdType
 
concept  QuaternionSimdType
 
concept  QuaternionType
 
concept  QuaternionOrQuaternionSimdType
 
concept  SquareMatrixSimdType
 
concept  SquareMatrixType
 
concept  SquareMatrixOrSquareMatrixSimdType
 
concept  PlaneSimdType
 
concept  PlaneType
 
concept  PlaneOrPlaneSimdType
 

Typedefs

template<FloatingPointType T>
using Line2 = Line<T, 2>
 
using Line2f = Line2<float>
 
using Line2d = Line2<double>
 
template<FloatingPointType T>
using Line3 = Line<T, 3>
 
using Line3f = Line3<float>
 
using Line3d = Line3<double>
 
template<FloatingPointType T>
using Segment2 = Segment<T, 2>
 
using Segment2f = Segment2<float>
 
using Segment2d = Segment2<double>
 
template<FloatingPointType T>
using Segment3 = Segment<T, 3>
 
using Segment3f = Segment3<float>
 
using Segment3d = Segment3<double>
 
using Vector2f = Vector<float, 2>
 
using Vector2d = Vector<double, 2>
 
using Vector2i = Vector<int, 2>
 
using Vector3f = Vector<float, 3>
 
using Vector3d = Vector<double, 3>
 
using Vector3i = Vector<int, 3>
 
using Vector4f = Vector<float, 4>
 
using Vector4d = Vector<double, 4>
 
using Vector4i = Vector<int, 4>
 
using Point2i = Point<Int32, 2>
 
using Point3i = Point<Int32, 3>
 
using Point2f = Point<float, 2>
 
using Point3f = Point<float, 3>
 
using Normal3f = Normal<float, 3>
 

Enumerations

enum class  MatrixType : UInt32 {
  Zero ,
  Identity
}
 

Functions

template<FloatingPointType T>
constexpr bool IsSameValue (T first, T second) noexcept
 Tests whether two floating point values holds the same value. This function returns true if both hold the same NaN value.
 
template<FloatingPointType T>
constexpr bool IsZero (T x) noexcept
 Tests if a floating point value is zero.
 
template<UnsignedIntegerOrBooleanType T>
constexpr T signum (T val) noexcept
 Returns the sign of a value for a signed integer type.
 
template<FloatingPointType T>
constexpr T Deg2Rad (T angleInDegrees) noexcept
 Converts an angle in degrees into the corresponding angle in radians.
 
template<FloatingPointType T>
constexpr T Rad2Deg (T angleInRadians) noexcept
 Converts an angle in radians into the corresponding angle in degrees.
 
constexpr double NextAfter (double x, double y) noexcept
 
constexpr float NextAfter (float x, float y) noexcept
 
template<FloatingPointType T>
constexpr T Sqrt (T x) noexcept
 
template<FloatingPointType T>
constexpr T ReciprocalSqrt (T x) noexcept
 
template<FloatingPointType T>
constexpr T Cbrt (T x) noexcept
 
template<FloatingPointType T>
constexpr T NextDown (T x) noexcept
 
template<FloatingPointType T>
constexpr T NextUp (T x) noexcept
 
template<IntegerType T>
constexpr bool IsNaN (T val) noexcept
 IsNaN for integer types, always returns false.
 
template<ArithmeticType T, ArithmeticType ... Args>
constexpr bool IsNaN (T val, Args ... args) noexcept
 Determines if any of the given integral or floating point values are a not-a-number (NaN) value.
 
template<IntegerType T>
constexpr bool IsInf (T val) noexcept
 Integers cannot represent infinite, so this function always returns false.
 
template<ArithmeticType T, ArithmeticType ... Args>
constexpr bool IsInf (T val, Args ... args) noexcept
 Determines if any of the given integral or floating point numbers is positive or negative infinity.
 
template<IntegerType T>
constexpr bool IsFinite (T val) noexcept
 All integers have finite values.
 
template<ArithmeticType T, ArithmeticType ... Args>
constexpr bool IsFinite (T val, Args ... args) noexcept
 Determines if all the arguments are finite.
 
template<IntegerType T>
constexpr bool IsNormal (T val) noexcept
 All integers, except 0, are <q>normal</q>.
 
template<ArithmeticType T, ArithmeticType ... Args>
constexpr bool IsNormal (T val, Args ... args) noexcept
 Determines if all the arguments are normal.
 
template<SignedIntegerType T>
constexpr T Abs (T val) noexcept
 The absolute value of any unsigned integer is the same as its value.
 
template<UnsignedIntegerType T>
constexpr T FastAbs (T val) noexcept
 
template<SignedIntegerType T>
constexpr bool SignBit (T val) noexcept
 Determines if the given signed integer value is negative.
 
template<FloatingPointType T>
constexpr std::pair< T, int > FRExp (T val) noexcept
 
template<FloatingPointType T>
constexpr T FRExp (T val, int *exp) noexcept
 
template<FloatingPointType T>
constexpr T FRExp (T val, int &exp) noexcept
 
template<FloatingPointType T>
constexpr std::pair< T, T > ModF (T val) noexcept
 
template<FloatingPointType T>
constexpr T ModF (T val, T *integerPart) noexcept
 
template<FloatingPointType T>
constexpr T ModF (T val, T &integerPart) noexcept
 
template<FloatingPointType T>
constexpr T Min (T first, T second) noexcept
 Returns the smaller of the given values.
 
template<FloatingPointType T, FloatingPointType ... Args>
constexpr T Min (T first, T second, Args... remaining) noexcept
 
template<FloatingPointType T>
constexpr T Max (T first, T second) noexcept
 Returns the larger of the given values.
 
template<FloatingPointType T, FloatingPointType ... Args>
constexpr T Max (T first, T second, Args... remaining) noexcept
 
template<SimpleSpanLike T>
requires IsArithmetic<typename T::value_type>
constexpr T::value_type Multiply (const T &values)
 
template<FloatingPointType T>
constexpr T Trunc (T value) noexcept
 Just returns value.
 
template<FloatingPointType T>
constexpr T Floor (T value) noexcept
 Just returns value.
 
template<FloatingPointType T>
constexpr T Ceil (T value) noexcept
 Just returns value.
 
template<FloatingPointType T>
constexpr T Round (T value) noexcept
 Just returns value.
 
template<ArithmeticType T1, ArithmeticType T2, ArithmeticType T3>
constexpr T1 Clamp (T1 value, T2 minimumValue, T3 maximumValue) noexcept
 
template<ArithmeticType T, ArithmeticType U>
constexpr auto Lerp (T a, T b, U t) noexcept
 
template<ArithmeticType T, ArithmeticType U>
constexpr auto Lerp2 (U t, T a, T b) noexcept
 
template<FloatingPointType T>
constexpr T CopySign (T magnitude, T signValue) noexcept
 
constexpr double ScaleBN (double x, int n) noexcept
 
constexpr float ScaleBN (float x, int n) noexcept
 
template<FloatingPointType T>
constexpr T FMod (T x, T y) noexcept
 
template<FloatingPointType T>
constexpr T Exp (T x) noexcept
 
template<FloatingPointType T>
constexpr T ExpM1 (T x) noexcept
 
template<FloatingPointType T>
constexpr T Exp2 (T x) noexcept
 
template<FloatingPointType T>
constexpr T Exp10 (T x) noexcept
 
template<FloatingPointType T>
constexpr T Hypot (T x, T y) noexcept
 
template<FloatingPointType T>
constexpr T Hypot (T x, T y, T z) noexcept
 
template<FloatingPointType T>
constexpr T Log (T x) noexcept
 
template<FloatingPointType T>
constexpr T Log1P (T x) noexcept
 
template<FloatingPointType T>
constexpr T Log2 (T x) noexcept
 
template<FloatingPointType T>
constexpr T Log10 (T x) noexcept
 
template<FloatingPointType T>
constexpr T LogB (T x) noexcept
 Extracts the value of the unbiased radix-independent exponent from the floating-point argument x, and returns it as a floating-point value.
 
template<FloatingPointType T>
constexpr int ILogB (T x) noexcept
 Extracts the value of the unbiased exponent from the floating-point argument x, and returns it as a signed integer value.
 
template<FloatingPointType T>
constexpr T Pow (T x, T y) noexcept
 Computes the value of x raised to the power y.
 
template<FloatingPointType T>
constexpr T Sin (T x) noexcept
 
template<FloatingPointType T>
constexpr T ASin (T x) noexcept
 
template<FloatingPointType T>
constexpr T Cos (T x) noexcept
 
template<FloatingPointType T>
constexpr T ACos (T x) noexcept
 
template<FloatingPointType T>
constexpr T Tan (T x) noexcept
 
template<FloatingPointType T>
constexpr T ATan (T x) noexcept
 
template<FloatingPointType T>
constexpr T ATan (T y, T x) noexcept
 
template<FloatingPointType T>
constexpr T ATan2 (T y, T x) noexcept
 
template<FloatingPointType T>
constexpr void SinCos (T x, T &sinResult, T &cosResult) noexcept
 Simultaneously compute the sine and cosine of x, where x is in radians, returning the sine in the variable referenced by sinResult, and the cosine in the variable referenced by cosResult.
 
template<FloatingPointType T>
constexpr void SinCos (T x, T *sinResult, T *cosResult) noexcept
 Simultaneously compute the sine and cosine of x, where x is in radians, returning the sine in the variable referenced by sinResult, and the cosine in the variable referenced by cosResult.
 
template<FloatingPointType T>
constexpr T SinH (T x) noexcept
 Calculates the hyperbolic sine of x.
 
template<FloatingPointType T>
constexpr T ASinH (T x) noexcept
 Calculates the inverse hyperbolic sine of x.
 
template<FloatingPointType T>
constexpr T CosH (T x) noexcept
 Calculates the hyperbolic cosine of x.
 
template<FloatingPointType T>
constexpr T ACosH (T x) noexcept
 Calculates the inverse hyperbolic cosine of x.
 
template<FloatingPointType T>
constexpr T TanH (T x) noexcept
 Calculates the hyperbolic tangent of x.
 
template<FloatingPointType T>
constexpr T ATanH (T x) noexcept
 Calculates the inverse hyperbolic tangent of x.
 
template<FloatingPointType T>
constexpr T J0 (T x) noexcept
 Calculates the Bessel function of the first kind of order 0 for x.
 
template<FloatingPointType T>
constexpr T J1 (T x) noexcept
 Calculates the Bessel function of the first kind of order 1 for x.
 
template<FloatingPointType T>
constexpr T JN (int n, T x) noexcept
 Calculates the Bessel function of the first kind of order n for x.
 
template<FloatingPointType T>
constexpr T Y0 (T x) noexcept
 Calculates the Bessel function of the second kind of order 0 for x.
 
template<FloatingPointType T>
constexpr T Y1 (T x) noexcept
 Calculates the Bessel function of the second kind of order 1 for x.
 
template<FloatingPointType T>
constexpr T YN (int n, T x) noexcept
 Calculates the Bessel function of the second kind of order n for x.
 
template<FloatingPointType T>
constexpr T Erf (T x) noexcept
 Computes the error function of x.
 
template<FloatingPointType T>
constexpr T ErfC (T x) noexcept
 Computes the complementary error function of x,.
 
template<FloatingPointType T>
constexpr T TGamma (T x) noexcept
 Computes the gamma function of x.
 
template<FloatingPointType T>
constexpr T LGamma (T x) noexcept
 Computes the natural logarithm of the absolute value of the gamma function of x.
 
template<FloatingPointType T>
constexpr T Remainder (T x, T y) noexcept
 Computes the IEEE remainder of the floating point division operation x / y.
 
template<FloatingPointType T>
constexpr T RemQuo (T x, T y, int *quo) noexcept
 Computes the floating-point remainder of the division operation x / y like Remainder. Additionally, the sign and at least the three of the last bits of x / y will be stored in quo, sufficient to determine the octant of the result within a period.
 
template<FloatingPointType T>
constexpr T FDim (T x, T y) noexcept
 Returns the positive difference between x and y, that is, if x > y, returns x - y, otherwise (i.e. if x <= y) returns +0.
 
template<IntegerType T>
constexpr T FMA (T a, T b, T c) noexcept
 Computes x * y + z.
 
template<FloatingPointType T>
constexpr T SinXOverX (T x)
 
template<FloatingPointType T>
constexpr T Sinc (T x)
 
template<FloatingPointType T>
constexpr T WindowedSinc (T x, T radius, T tau)
 
template<FloatingPointType T>
constexpr T Mod (T a, T b)
 
template<FloatingPointType T>
constexpr T Radians (T deg)
 
template<FloatingPointType T>
constexpr T Degrees (T rad)
 
template<FloatingPointType T>
constexpr T SmoothStep (T x, T a, T b)
 
template<FloatingPointType T>
constexpr T SafeSqrt (T x)
 
template<typename T >
requires IsArithmetic<T> || Internal::IsComplex<T>
constexpr T Sqr (T v)
 
template<int n, FloatingPointType T>
constexpr T FastPow (T v)
 
template<ArithmeticType T, ArithmeticType C>
constexpr T EvaluatePolynomial (T t, C c)
 
template<ArithmeticType T, ArithmeticType C, ArithmeticType ... Args>
constexpr T EvaluatePolynomial (T t, C c, Args... remaining)
 
template<FloatingPointType T>
constexpr T SafeASin (T x)
 
template<FloatingPointType T>
constexpr T SafeACos (T x)
 
template<FloatingPointType T>
constexpr T NextFloatUp (T v)
 
template<FloatingPointType T>
constexpr T NextFloatDown (T v)
 
template<FloatingPointType T>
constexpr T Gamma (int n)
 
template<FloatingPointType T>
constexpr T AddAdjustUp (T a, T b)
 
template<FloatingPointType T>
constexpr T AddAdjustDown (T a, T b)
 
template<FloatingPointType T>
constexpr T SubAdjustUp (T a, T b)
 
template<FloatingPointType T>
constexpr T SubAdjustDown (T a, T b)
 
template<FloatingPointType T>
constexpr T MulAdjustUp (T a, T b)
 
template<FloatingPointType T>
constexpr T MulAdjustDown (T a, T b)
 
template<FloatingPointType T>
constexpr T DivAdjustUp (T a, T b)
 
template<FloatingPointType T>
constexpr T DivAdjustDown (T a, T b)
 
template<FloatingPointType T>
constexpr T SqrtAdjustUp (T a)
 
template<FloatingPointType T>
constexpr T SqrtAdjustDown (T a)
 
template<FloatingPointType T>
constexpr T FMAAdjustUp (T a, T b, T c)
 
template<FloatingPointType T>
constexpr T FMAAdjustDown (T a, T b, T c)
 
template<FloatingPointType T>
constexpr T FastLog2 (T x)
 
constexpr int Log2Int (float v)
 
constexpr int Log2Int (double v)
 
constexpr int Log2Int (UInt32 v)
 
constexpr int Log2Int (Int32 v)
 
constexpr int Log2Int (UInt64 v)
 
constexpr int Log2Int (Int64 v)
 
template<typename T >
requires std::is_arithmetic_v<T>
constexpr int Log4Int (T v)
 
constexpr float FastExp (float x)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT Gaussian (FloatT x, FloatT mu=0, FloatT sigma=1)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT GaussianIntegral (FloatT x0, FloatT x1, FloatT mu=0, FloatT sigma=1)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT Logistic (FloatT x, FloatT s)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT LogisticCDF (FloatT x, FloatT s)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT TrimmedLogistic (FloatT x, FloatT s, FloatT a, FloatT b)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT ErfInv (FloatT a)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT I0 (FloatT x)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr FloatT LogI0 (FloatT x)
 
template<typename Predicate >
constexpr size_t FindInterval (size_t sz, const Predicate &pred)
 
template<typename T >
constexpr bool IsPowerOf4 (T v)
 
constexpr Int32 RoundUpPow2 (Int32 v)
 
constexpr Int64 RoundUpPow2 (Int64 v)
 
template<typename T >
constexpr T RoundUpPow4 (T v)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr CompensatedFloat< FloatT > TwoProd (FloatT a, FloatT b)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr CompensatedFloat< FloatT > TwoSum (FloatT a, FloatT b)
 
template<typename Ta , typename Tb , typename Tc , typename Td >
requires IsFloatingPoint<Ta>&& IsFloatingPoint<Tb>&& IsFloatingPoint<Tc>&& IsFloatingPoint<Td>
constexpr auto DifferenceOfProducts (Ta a, Tb b, Tc c, Td d)
 
template<typename Ta , typename Tb , typename Tc , typename Td >
requires IsFloatingPoint<Ta>&& IsFloatingPoint<Tb>&& IsFloatingPoint<Tc>&& IsFloatingPoint<Td>
constexpr auto SumOfProducts (Ta a, Tb b, Tc c, Td d)
 
template<typename FloatT , typename... T>
requires std::conjunction_v<std::is_arithmetic<T>...>
constexpr FloatT InnerProduct (FloatT term, T... terms)
 
template<typename FloatT , typename... T>
requires IsFloatingPoint<FloatT>
constexpr bool Quadratic (FloatT a, FloatT b, FloatT c, FloatT *t0, FloatT *t1)
 
template<typename Func , typename FloatT >
constexpr FloatT NewtonBisection (FloatT x0, FloatT x1, Func f, FloatT xEps=static_cast< FloatT >(1e-6), FloatT fEps=static_cast< FloatT >(1e-6))
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr bool InRange (FloatT value, const Interval< FloatT > &interval)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr bool InRange (const Interval< FloatT > &first, const Interval< FloatT > &second)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
constexpr Interval< FloatT > Sqr (const Interval< FloatT > &interval)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > MulPow2 (FloatT s, const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > MulPow2 (const Interval< FloatT > &i, FloatT s)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator+ (FloatT f, const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator- (FloatT f, const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator* (FloatT f, const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator/ (FloatT f, const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator+ (const Interval< FloatT > &i, FloatT f)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator- (const Interval< FloatT > &i, FloatT f)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator* (const Interval< FloatT > &i, FloatT f)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > operator/ (const Interval< FloatT > &i, FloatT f)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Floor (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Ceil (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT floor (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT ceil (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Min (const Interval< FloatT > &a, const Interval< FloatT > &b)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Max (const Interval< FloatT > &a, const Interval< FloatT > &b)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT min (const Interval< FloatT > &a, const Interval< FloatT > &b)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT max (const Interval< FloatT > &a, const Interval< FloatT > &b)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Sqrt (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > sqrt (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > FMA (const Interval< FloatT > &a, const Interval< FloatT > &b, const Interval< FloatT > &c)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > DifferenceOfProducts (const Interval< FloatT > &a, const Interval< FloatT > &b, const Interval< FloatT > &c, const Interval< FloatT > &d)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > SumOfProducts (const Interval< FloatT > &a, const Interval< FloatT > &b, const Interval< FloatT > &c, const Interval< FloatT > &d)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Abs (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > abs (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > ACos (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Sin (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Cos (const Interval< FloatT > &i)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
void SinCos (const Interval< FloatT > &i, Interval< FloatT > *sine, Interval< FloatT > *cosine)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
bool Quadratic (const Interval< FloatT > &a, const Interval< FloatT > &b, const Interval< FloatT > &c, Interval< FloatT > *t0, Interval< FloatT > *t1)
 
template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > SumSquares (const Interval< FloatT > &i)
 
template<typename FloatT , typename... Args>
requires IsFloatingPoint<FloatT>
Interval< FloatT > SumSquares (const Interval< FloatT > &i, Args... args)
 
template<FloatingPointType T, size_t N>
Vector< T, N > Length (const SegmentSimd< T, N > &segment) noexcept
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto operator+ (const T &lhs, const U &rhs) noexcept
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto operator+ (const T &lhs, const U &rhs) noexcept
 
template<ArithmeticType T, SimdType U>
auto operator+ (const T lhs, const U &rhs) noexcept
 
template<SimdType T, ArithmeticType U>
auto operator+ (const T &lhs, const U rhs) noexcept
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto operator- (const T &lhs, const U &rhs) noexcept
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto operator- (const T &lhs, const U &rhs) noexcept
 
template<ArithmeticType T, SimdType U>
auto operator- (const T lhs, const U &rhs) noexcept
 
template<SimdType T, ArithmeticType U>
auto operator- (const T &lhs, const U rhs) noexcept
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto operator* (const T &lhs, const U &rhs) noexcept
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto operator* (const T &lhs, const U &rhs) noexcept
 
template<ArithmeticType T, SimdType U>
auto operator* (const T lhs, const U &rhs) noexcept
 
template<SimdType T, ArithmeticType U>
auto operator* (const T &lhs, const U rhs) noexcept
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto operator/ (const T &lhs, const U &rhs) noexcept
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto operator/ (const T &lhs, const U &rhs) noexcept
 
template<ArithmeticType T, SimdType U>
auto operator/ (const T lhs, const U &rhs) noexcept
 
template<SimdType T, ArithmeticType U>
auto operator/ (const T &lhs, const U rhs) noexcept
 
template<SimdType T>
auto First (const T &v)
 Retrieves the lowest element of v.
 
template<SimdType T>
HSum (const T &t) noexcept
 Calculates the horizontal sum of the elements in the vector.
 
template<SimdType T>
T::value_type ScalarHSum (const T &t) noexcept
 Calculates the horizontal sum of the elements in the vector.
 
template<TupleType T>
T::Simd HSum (const T &t) noexcept
 Calculates the horizontal sum of the elements in the vector.
 
template<SimdType T>
auto Avg (const T &t) noexcept
 
template<SimdOrTupleType T>
T::value_type ScalarAvg (const T &t) noexcept
 Calculates the average value of the elements in the argument.
 
template<SimdType T>
HProd (const T &t) noexcept
 Calculates the horizontal product of the elements in the vector.
 
template<SimdType T>
auto ScalarHProd (const T &t) noexcept
 
template<TupleType T, typename ResultT = typename T::value_type>
ResultT ScalarHProd (const T &t) noexcept
 Calculates the horizontal product of the elements in the vector.
 
template<TupleType T>
T::Simd HProd (const T &t) noexcept
 Calculates the horizontal product of the elements in the vector.
 
template<SimdOrTupleType T>
bool AllTrue (const T &v) noexcept
 Returns true if all the elements of the argument have all their bits set to 1.
 
template<SimdOrTupleType T>
bool AnyTrue (const T &v) noexcept
 Returns true if any of the elements of the argument have all their bits set to 1.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Less (const T &v1, const U &v2) noexcept
 Determines whether the elements of v1 are less than the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
auto Less (const T &v1, U value) noexcept
 Determines whether the elements of v1 are less than value.
 
template<ArithmeticType T, SimdOrTupleType U>
auto Less (T value, const U &v2) noexcept
 Determines whether value is less than the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AllLess (const T &v1, const U &v2) noexcept
 Determines whether all the elements of v1 are less than the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AllLess (const T &v1, U value) noexcept
 Determines whether all the elements of v1 are less than value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AllLess (T value, const U &v2) noexcept
 Determines whether value is less than all of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AnyLess (const T &v1, const U &v2) noexcept
 Determines whether any of the elements of v1 are less than the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AnyLess (const T &v1, U value) noexcept
 Determines whether any of the elements of v1 are less than value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AnyLess (T value, const U &v2) noexcept
 Determines whether value is less than any of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto LessOrEqual (const T &v1, const U &v2) noexcept
 Determines whether the elements of v1 are less than, or equal to, the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
auto LessOrEqual (const T &v1, const U value) noexcept
 Determines whether the elements of v1 are less than, or equal to, value.
 
template<ArithmeticType T, SimdOrTupleType U>
auto LessOrEqual (const T value, const U &v2) noexcept
 Determines whether value is less than, or equal to, the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AllLessOrEqual (const T &v1, const U &v2) noexcept
 Determines whether all the elements of v1 are less than, or equal to, the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AllLessOrEqual (const T &v1, const U value) noexcept
 Determines whether all the elements of v1 are less than, or equal to, value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AllLessOrEqual (const T value, const U &v2) noexcept
 Determines whether value is less than, or equal to, all of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AnyLessOrEqual (const T &v1, const U &v2) noexcept
 Determines whether any of the elements of v1 are less than, or equal to, the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AnyLessOrEqual (const T &v1, const U value) noexcept
 Determines whether any of the elements of v1 are less than, or equal to, value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AnyLessOrEqual (const T value, const U &v2) noexcept
 Determines whether value is less than, or equal to, any of the elements of v2.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Equal (const S &lhs, const T &rhs, const U &epsilon) noexcept
 Determines whether the elements of lhs and the corresponding elements of rhs are less or equally apart than the corresponding element of epsilon.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Equal (const S &lhs, const T &rhs, U epsilon) noexcept
 Determines whether the elements of lhs and the corresponding elements of rhs are less or equally apart than the value of epsilon.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
bool AllEqual (const S &lhs, const T &rhs, const U &epsilon) noexcept
 Determines whether all the elements of lhs and their corresponding element of rhs are less or equally apart than the corresponding element of epsilon.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
bool AllEqual (const S &lhs, const T &rhs, const U epsilon) noexcept
 Determines whether all the elements of lhs and their corresponding element of rhs are less or equally apart than the value of epsilon.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
bool AnyEqual (const S &lhs, const T &rhs, const U &epsilon) noexcept
 Determines whether any of the elements of lhs and their corresponding element of rhs are less or equally apart than the corresponding element of epsilon.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
bool AnyEqual (const S &lhs, const T &rhs, U epsilon) noexcept
 Determines whether any of the elements of lhs and their corresponding element of rhs are less or equally apart than the value of epsilon.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Equal (const T &v1, const U &v2) noexcept
 Determines whether the elements of v1 are equal to the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
auto Equal (const T &v1, U value) noexcept
 Determines whether the elements of v1 are equal to value.
 
template<ArithmeticType T, SimdOrTupleType U>
auto Equal (const T value, const U &v2) noexcept
 Determines whether value is equal to the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AllEqual (const T &v1, const U &v2) noexcept
 Determines whether all the elements of v1 are equal to the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AllEqual (const T &v1, const U value) noexcept
 Determines whether all the elements of v1 are equal to value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AllEqual (T value, const U &v2) noexcept
 Determines whether value is equal to all the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AnyEqual (const T &v1, const U &v2) noexcept
 Determines whether any of the elements of v1 are equal to the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AnyEqual (const T &v1, const U value) noexcept
 Determines whether any of the elements of v1 are equal to value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AnyEqual (const T value, const U &v2) noexcept
 Determines whether value is equal to any of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto NotEqual (const T &v1, const U &v2) noexcept
 Determines whether the elements of v1 are not equal to the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
auto NotEqual (const T &v1, const U value) noexcept
 Determines whether the elements of v1 are not equal to value.
 
template<ArithmeticType T, SimdOrTupleType U>
auto NotEqual (T value, const U &v2) noexcept
 Determines whether value is not equal to the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AllNotEqual (const T &v1, const U &v2) noexcept
 Determines whether all the elements of v1 are not equal to the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AllNotEqual (const T &v1, const U value) noexcept
 Determines whether all the elements of v1 are not equal to value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AllNotEqual (T value, const U &v2) noexcept
 Determines whether value is not equal to all the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AnyNotEqual (const T &v1, const U &v2) noexcept
 Determines whether any of the elements of v1 are not equal to the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AnyNotEqual (const T &v1, const U value) noexcept
 Determines whether any of the elements of v1 are not equal to value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AnyNotEqual (const T value, const U &v2) noexcept
 Determines whether value is not equal to any of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto GreaterOrEqual (const T &v1, const U &v2) noexcept
 Determines whether the elements of v1 are greater than, or equal to, the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
auto GreaterOrEqual (const T &v1, const U value) noexcept
 Determines whether the elements of v1 are greater than, or equal to, value.
 
template<ArithmeticType T, SimdOrTupleType U>
auto GreaterOrEqual (const T value, const U &v2) noexcept
 Determines whether value is greater than, or equal to, the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AllGreaterOrEqual (const T &v1, const U &v2) noexcept
 Determines whether all the elements of v1 are greater than, or equal to, the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AllGreaterOrEqual (const T &v1, const U value) noexcept
 Determines whether all the elements of v1 are greater than, or equal to, value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AllGreaterOrEqual (const T value, const U &v2) noexcept
 Determines whether value is greater than, or equal to, all of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AnyGreaterOrEqual (const T &v1, const U &v2) noexcept
 Determines whether any of the elements of v1 are greater than, or equal to, the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AnyGreaterOrEqual (const T &v1, const U value) noexcept
 Determines whether any of the elements of v1 are greater than, or equal to, value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AnyGreaterOrEqual (const T value, const U &v2) noexcept
 Determines whether value is greater than, or equal to, any of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Greater (const T &v1, const U &v2) noexcept
 Determines whether the elements of v1 are greater than the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
auto Greater (const T &v1, U value) noexcept
 Determines whether the elements of v1 are greater than value.
 
template<ArithmeticType T, SimdOrTupleType U>
auto Greater (T value, const U &v2) noexcept
 Determines whether value is greater than the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AllGreater (const T &v1, const U &v2) noexcept
 Determines whether all the elements of v1 are greater than the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AllGreater (const T &v1, U value) noexcept
 Determines whether all the elements of v1 are greater than value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AllGreater (T value, const U &v2) noexcept
 Determines whether value is greater than all of the elements of v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool AnyGreater (const T &v1, const U &v2) noexcept
 Determines whether any of the elements of v1 are greater than the corresponding elements of v2.
 
template<SimdOrTupleType T, ArithmeticType U>
bool AnyGreater (const T &v1, U value) noexcept
 Determines whether any of the elements of v1 are greater than value.
 
template<ArithmeticType T, SimdOrTupleType U>
bool AnyGreater (T value, const U &v2) noexcept
 Determines whether value is greater than any of the elements of v2.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
Select (const S &v1, const T &v2, const U &control) noexcept
 Performs a per-component selection between two input vectors and returns the resulting vector.
 
template<SimdOrTupleType T>
auto IsNaN (const T &t) noexcept
 Determines which of the elements of t are NaN.
 
template<SimdOrTupleType T>
auto IsInf (const T &t) noexcept
 Determines which of the elements of t are Inf.
 
template<SimdOrTupleType T>
auto Abs (const T &t) noexcept
 Computes the absolute value of each element held by the argument.
 
template<SimdOrTupleType T>
auto FastAbs (const T &t) noexcept
 Computes the absolute value of each element held by the argument.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Min (const T &lhs, const U &rhs) noexcept
 Makes a comparison between the elements held by the two arguments, and returns a TupleSimd derived object containing the smallest elements.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Max (const T &lhs, const U &rhs) noexcept
 Makes a comparison between the elements held by the two arguments, and returns a TupleSimd containing the largest elements.
 
template<SimdOrTupleType T>
auto Sqr (const T &t) noexcept
 Computes the square value of each element held by the argument.
 
template<SimdOrTupleType T>
auto Ceil (const T &t) noexcept
 Computes the ceiling of each element held by the argument.
 
template<SimdOrTupleType T>
auto Floor (const T &t) noexcept
 Computes the floor of each element held by the argument.
 
template<SimdOrTupleType T>
auto Round (const T &t) noexcept
 Rounds each element held by the argument towards the nearest even integer.
 
template<SimdOrTupleType T>
auto Trunc (const T &t) noexcept
 Rounds each element held by the argument to the nearest integer in the direction of zero.
 
template<SimdType T, SimdType U, ArithmeticType NumberT>
requires IsCompatible<T, U>
auto Lerp (const T &a, const U &b, NumberT t) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<SimdOrTupleType T, SimdOrTupleType U, ArithmeticType NumberT>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Lerp (const T &a, const U &b, NumberT t) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto Lerp (const S &a, const T &b, const U &t) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto Lerp (const S &a, const T &b, const U &t) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<ArithmeticType NumberT1, ArithmeticType NumberT2, SimdOrTupleType T>
auto Lerp (const NumberT1 a, const NumberT2 b, const T &t) noexcept
 Calculates the linear interpolation between a and b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<ArithmeticType S, SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Lerp2 (const S t, const T &a, const U &b) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Lerp2 (const S t, const T &a, const U &b) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto Lerp2 (const S &t, const T &a, const U &b) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto Lerp2 (const S &t, const T &a, const U &b) noexcept
 Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<SimdType S, ArithmeticType T, ArithmeticType U>
auto Lerp2 (const S &t, const T a, const U b) noexcept
 Calculates the linear interpolation between a and b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).
 
template<int shuffleMask, SimdOrTupleType T>
Permute (const T &t) noexcept
 
template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto Clamp (const S &v, const T &lowerBounds, const U &upperBounds) noexcept
 Returns the elements of v, if the elements are between their respective boundaries specified by the elements of lowerBounds and the elements of upperBounds, otherwise the value of nearest boundary is returned.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto Clamp (const S &v, const T &lowerBounds, const U &upperBounds) noexcept
 Returns the elements of v, if the elements are between their respective boundaries specified by the elements of lowerBounds and the elements of upperBounds, otherwise the value of nearest boundary is returned.
 
template<SimdType S, ArithmeticType T, ArithmeticType U>
auto Clamp (const S &v, const T lowerBounds, const U upperBounds) noexcept
 Returns the elements of v, if the elements are between their respective boundaries specified by lowerBounds and upperBounds, otherwise the value of nearest boundary is returned.
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Clamp (const S v, const T &lowerBounds, const U &upperBounds) noexcept
 Returns the elements of v, if the elements are between their respective boundaries specified by the elements of lowerBounds and the elements of upperBounds, otherwise the value of nearest boundary is returned.
 
template<SimdOrTupleType S>
auto ClampZero (const S &v) noexcept
 
template<SimdOrTupleType S, SimdOrTupleType T>
requires IsCompatible<S, T>
auto InBounds (const S &v, const T &bounds) noexcept
 Detects if the elements of a vector are within bounds.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto ClampLength (const S &v, const T &lengthMin, const U &lengthMax) noexcept
 Clamps the length of a vector to a given range.
 
template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto ClampLength (const S &v, const T lengthMin, const U lengthMax) noexcept
 Clamps the length of a vector to a given range.
 
template<SimdOrTupleType S, SimdOrTupleType T>
requires IsCompatible<S, T>
auto Reflect (const S &incident, const T &normal) noexcept
 Reflects an incident vector across a normal vector.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Refract (const S &incident, const T &normal, const U &refractionIndex) noexcept
 Refracts an incident vector across a normal vector.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Refract (const S &incident, const T &normal, const U refractionIndex) noexcept
 Refracts an incident vector across a normal vector.
 
template<SimdOrTupleType S>
auto Orthogonal (const S &v) noexcept
 Computes a vector perpendicular to the argument vector.
 
template<SimdOrTupleType T>
auto Saturate (const T &v) noexcept
 Saturates the elements of v to the range 0.0 to 1.0.
 
template<SimdOrTupleType T>
auto Sqrt (const T &v) noexcept
 Calculates the square root of each element in the argument.
 
template<SimdOrTupleType T>
auto Cbrt (const T &v) noexcept
 Calculates the cube root of each element in the argument.
 
template<SimdOrTupleType T>
auto SafeSqrt (const T &v) noexcept
 Calculates the square root of each element greater or equal to 0.f in the argument. For elements less than 0.f, the result is 0.f.
 
template<SimdOrTupleType T>
auto ReciprocalSqrt (const T &v) noexcept
 Calculates the reciprocal square root of each element in the argument.
 
template<SimdOrTupleType T>
auto Reciprocal (const T &t) noexcept
 Calculates the reciprocal of each element in the argument.
 
template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto FMA (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto FMA (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto FMA (const S &a, const T &b, const U c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto FMA (const S &a, const T b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto FMA (const S &a, const T b, const U c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FMA (const S a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto FMA (const S a, const T &b, const U c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto FMA (const S a, const T b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdType T, typename C >
requires IsArithmetic<C>
constexpr T EvaluatePolynomial (const T &t, C c)
 Evaluates the provided polynomial using Horner’s method.
 
template<SimdType T, SimdType C>
requires IsCompatible<T, C>
constexpr T EvaluatePolynomial (const T &t, C c)
 
template<SimdType T, typename C , typename... Args>
requires IsArithmetic<C>
constexpr T EvaluatePolynomial (const T &t, C c, Args... remaining)
 
template<TupleType T, typename C , typename... Args>
requires IsArithmetic<C>
constexpr T::Simd EvaluatePolynomial (const T &t, C c, Args... remaining)
 
template<SimdType T, SimdType C, typename... Args>
requires IsCompatible<T, C>
constexpr T EvaluatePolynomial (const T &t, const C &c, Args... remaining)
 
template<TupleType T, SimdType C, typename... Args>
requires IsCompatible<T, C>
constexpr T::Simd EvaluatePolynomial (const T &t, const C &c, Args... remaining)
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto FMSub (const S &a, const T &b, const U &c) noexcept
 Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto FMSub (const S &a, const T &b, const U c) noexcept
 Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto FMSub (const S &a, const T b, const U &c) noexcept
 Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto FMSub (const S &a, const T b, const U c) noexcept
 Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FMSub (const S a, const T &b, const U &c) noexcept
 Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto FMSub (const S a, const T &b, const U c) noexcept
 Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto FMSub (const S a, const T b, const U &c) noexcept
 Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto FMAddSub (const S &a, const T &b, const U &c) noexcept
 Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto FMAddSub (const S &a, const T &b, const U c) noexcept
 Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto FMAddSub (const S &a, const T b, const U &c) noexcept
 Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto FMAddSub (const S &a, const T b, const U c) noexcept
 Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FMAddSub (const S a, const T &b, const U &c) noexcept
 Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto FMAddSub (const S a, const T &b, const U c) noexcept
 Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto FMAddSub (const S a, const T b, const U &c) noexcept
 Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto FMSubAdd (const S &a, const T &b, const U &c) noexcept
 Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto FMSubAdd (const S &a, const T &b, const U c) noexcept
 Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto FMSubAdd (const S &a, const T b, const U &c) noexcept
 Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto FMSubAdd (const S &a, const T b, const U c) noexcept
 Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FMSubAdd (const S a, const T &b, const U &c) noexcept
 Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto FMSubAdd (const S a, const T &b, const U c) noexcept
 Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto FMSubAdd (const S a, const T b, const U &c) noexcept
 Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto FNMAdd (const S &a, const T &b, const U &c) noexcept
 Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto FNMAdd (const S &a, const T &b, const U c) noexcept
 Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto FNMAdd (const S &a, const T b, const U &c) noexcept
 Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto FNMAdd (const S &a, const T b, const U c) noexcept
 Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FNMAdd (const S a, const T &b, const U &c) noexcept
 Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto FNMAdd (const S a, const T &b, const U c) noexcept
 Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.
 
template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto FNMAdd (const S a, const T b, const U &c) noexcept
 Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto FNMSub (const S &a, const T &b, const U &c) noexcept
 Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.
 
template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto FNMSub (const S &a, const T &b, const U c) noexcept
 Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.
 
template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto FNMSub (const S &a, const T b, const U &c) noexcept
 Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.
 
template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto FNMSub (const S &a, const T b, const U c) noexcept
 Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.
 
template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FNMSub (const S a, const T &b, const U &c) noexcept
 Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.
 
template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto FNMSub (const S a, const T &b, const U c) noexcept
 Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.
 
template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto FNMSub (const S a, const T b, const U &c) noexcept
 Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.
 
template<SimdOrTupleType T>
auto Sin (const T &v) noexcept
 Calculates the sine of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto FastSin (const T &v) noexcept
 Calculates the sine of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto Cos (const T &v) noexcept
 Calculates the cosine of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto FastCos (const T &v) noexcept
 Calculates the cosine of each element in the argument expressed in radians.
 
template<SimdType T>
SinCos (const T &v, T *cosines) noexcept
 Calculates the sine and cosine of each element in the argument expressed in radians.
 
template<TupleType T>
T::Simd SinCos (const T &v, typename T::Simd *cosines) noexcept
 Calculates the sine and cosine of each element in the argument expressed in radians.
 
template<SimdType T>
FastSinCos (const T &v, T *cosines) noexcept
 Calculates the sine and cosine of each element in the argument expressed in radians.
 
template<TupleType T>
T::Simd FastSinCos (const T &v, typename T::Simd *cosines) noexcept
 Calculates the sine and cosine of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto Tan (const T &v) noexcept
 Calculates the tangent of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto FastTan (const T &v) noexcept
 Calculates the tangent of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto ASin (const T &v) noexcept
 Calculates the inverse sine of each element in the argument, in radians.
 
template<SimdOrTupleType T>
auto ACos (const T &v) noexcept
 Calculates the inverse cosine of each element in the argument, in radians.
 
template<SimdOrTupleType T>
auto ATan (const T &v) noexcept
 Calculates the inverse tangent of each element in the argument, in radians.
 
template<SimdOrTupleType T>
auto FastATan (const T &v) noexcept
 Calculates the inverse tangent of each element in the argument, in radians.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto ATan2 (const T &x, const U &y) noexcept
 Calculates the inverse tangent of each element in x divided by the corresponding element in y, in radians.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FastATan2 (const T &x, const U &y) noexcept
 Calculates the inverse tangent of each element in x divided by the corresponding element in y, in radians.
 
template<SimdOrTupleType T>
auto ModAngles (const T &angles)
 Calculates the angle modulo 2PI.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto AddAngles (const T &v1, const U &v2) noexcept
 Adds the angles in the corresponding elements of v1 and v2. The argument angles must be in the range [-PI,PI), and the computed angles will be in the range [-PI,PI)
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto SubtractAngles (const T &v1, const U &v2) noexcept
 Subtracts the angles in v2 from the corresponding elements of v1. The argument angles must be in the range [-PI,PI), and the computed angles will be in the range [-PI,PI)
 
template<SimdOrTupleType T>
auto SinH (const T &v) noexcept
 Calculates the hyperbolic sine of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto CosH (const T &v) noexcept
 Calculates the hyperbolic cosine of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto TanH (const T &v) noexcept
 Calculates the hyperbolic tangent of each element in the argument expressed in radians.
 
template<SimdOrTupleType T>
auto ASinH (const T &v) noexcept
 Calculates the inverse hyperbolic sine of each element in the argument, in radians.
 
template<SimdOrTupleType T>
auto ACosH (const T &v) noexcept
 Calculates the inverse hyperbolic cosine of each element in the argument, in radians.
 
template<SimdOrTupleType T>
auto ATanH (const T &v) noexcept
 Calculates the inverse hyperbolic tangent of each element in the argument, in radians.
 
template<SimdType T>
auto Log (const T &v) noexcept
 Calculates the natural logarithm of each element in the argument.
 
template<SimdType T>
auto Log1P (const T &v) noexcept
 Calculates the natural logarithm of 1 + each element in the argument.
 
template<SimdOrTupleType T>
auto Log10 (const T &v) noexcept
 Calculates the base-10 logarithm of each element in the argument.
 
template<SimdOrTupleType T>
auto Log2 (const T &v) noexcept
 Calculates the base-2 logarithm, $$log_{2}_$$, of each element in the argument.
 
template<SimdType T>
auto Exp (const T &v) noexcept
 Calculates $$e$$ (Euler's number, 2.7182818...), raised to the power of each element in the argument.
 
template<SimdOrTupleType T>
auto Exp10 (const T &v) noexcept
 Calculates the base-10 exponential of each element in the argument.
 
template<SimdOrTupleType T>
auto Exp2 (const T &v) noexcept
 Calculates the base-2 exponential of each element in the argument.
 
template<SimdOrTupleType T>
auto ExpM1 (const T &v) noexcept
 Calculates $$e$$ (Euler's number, 2.7182818...), raised to the power of each element in the argument, $$-1.0$$.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Pow (const T &base, const U &exponent) noexcept
 Calculates the elements in base raised to the corresponding element in exponent.
 
template<SimdOrTupleType T, ArithmeticType U>
auto Pow (const T &base, const U exponent) noexcept
 Calculates the elements in base raised to the value of exponent.
 
template<ArithmeticType T, SimdOrTupleType U>
auto Pow (const T &base, const U &exponent) noexcept
 Returns the value of base raised to the corresponding elements in exponent.
 
template<int n, SimdType T>
FastPow (const T &v)
 
template<int n, TupleType T>
T::Simd FastPow (const T &v)
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto FMod (const T &x, const U &y) noexcept
 Computes the floating-point remainder of the division operation $x/y$.
 
template<SimdOrTupleType T, ArithmeticType U>
auto FMod (const T &x, const U y) noexcept
 Computes the floating-point remainder of the division operation $x/y$.
 
template<ArithmeticType T, SimdOrTupleType U>
auto FMod (const T x, const U &y) noexcept
 Computes the floating-point remainder of the division operation $x/y$.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Hypot (const T &x, const U &y) noexcept
 Calculates the square root of the sum of the squares of each corresponding element in x and y, without undue overflow or underflow at intermediate stages of the computation.
 
template<SimdOrTupleType T, ArithmeticType U>
auto Hypot (const T &x, const U y) noexcept
 Calculates the square root of the sum of the squares of each corresponding element in x and y, without undue overflow or underflow at intermediate stages of the computation.
 
template<ArithmeticType T, SimdOrTupleType U>
auto Hypot (const T x, const U &y) noexcept
 Calculates the square root of the sum of the squares of each corresponding element in x and y, without undue overflow or underflow at intermediate stages of the computation.
 
template<SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, SimdOrTupleType W, ArithmeticType X>
requires IsCompatible<T, U, V, W>
auto Hermite (const T &firstPosition, const U &firstTangent, const V &secondPosition, const W &secondTangent, const X t) noexcept
 Calculates the Hermite spline interpolation, using the specified arguments.
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Dot (const T &v1, const U &v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasSimdType<T, U>&& Internal::HasTupleType<T, U>
auto Dot (const T &v1, const U &v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<SimdOrTupleType T, ArithmeticType U>
auto Dot (const T &v1, const U v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<ArithmeticType T, SimdOrTupleType U>
auto Dot (const T v1, const U &v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<TupleType T, TupleType U>
requires IsCompatible<T, U>
constexpr T::Simd Dot (const T &v1, const U &v2) noexcept
 
template<int mask, SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Dot (const T &v1, const U &v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<int mask, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasSimdType<T, U>&& Internal::HasTupleType<T, U>
auto Dot (const T &v1, const U &v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<int mask, SimdOrTupleType T, ArithmeticType U>
auto Dot (const T &v1, const U v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<int mask, ArithmeticType T, SimdOrTupleType U>
auto Dot (const T v1, const U &v2) noexcept
 Calculates the dot product between v1 and v2.
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
constexpr T::value_type ScalarDot (const T &v1, const U &v2) noexcept
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto AbsDot (const T &v1, const U &v2) noexcept
 Calculates the absolute value of the dot product between v1 and v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto ScalarAbsDot (const T &v1, const U &v2) noexcept
 Calculates the absolute value of the dot product between v1 and v2.
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Cross (const T &v1, const U &v2) noexcept
 Calculates the cross product between v1 and v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Cross (const T &v1, const U &v2) noexcept
 Calculates the cross product between v1 and v2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto UnitCross (const T &v1, const U &v2) noexcept
 Calculates the normalized cross product between v1 and v2.
 
template<SimdType T>
auto LengthSquared (const T &v) noexcept
 Calculates the squared length of v.
 
template<SimdType T>
auto ScalarLengthSquared (const T &q) noexcept
 Calculates the square of the magnitude of a quaternion.
 
template<SimdOrTupleType T>
auto Length (const T &v) noexcept
 Calculates the length of v.
 
template<SimdOrTupleType T>
auto ScalarLength (const T &v) noexcept
 Calculates the length of v.
 
template<SimdOrTupleType T>
auto Normalize (const T &v) noexcept
 Normalizes v.
 
template<SimdOrTupleType T>
auto ReciprocalLength (const T &v) noexcept
 Calculates the reciprocal length of v.
 
template<SimdOrTupleType T>
auto ScalarReciprocalLength (const T &v) noexcept
 Calculates the reciprocal length of v.
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto DistanceSquared (const T &p1, const U &p2) noexcept
 Calculates the squared distance between p1 and p2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto DistanceSquared (const T &p1, const U &p2) noexcept
 Calculates the squared distance between p1 and p2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasSimdType<T, U>
auto ScalarDistanceSquared (const T &p1, const U &p2) noexcept
 Calculates the squared distance between p1 and p2.
 
template<TupleType T, TupleType U>
requires IsCompatible<T, U>
constexpr auto ScalarDistanceSquared (const T &p1, const U &p2) noexcept
 Calculates the squared distance between p1 and p2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Distance (const T &p1, const U &p2) noexcept
 Calculates the distance between p1 and p2.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto ScalarDistance (const T &p1, const U &p2) noexcept
 
template<SimdTupleOrArithmeticType S, SimdOrTupleType T, SimdTupleOrArithmeticType U, SimdTupleOrArithmeticType V>
auto DifferenceOfProducts (const S &v1, const T &v2, const U &v3, const V &v4) noexcept
 Calculates the difference between the product of the first and the second argument, and the product of the third and fourth argument.
 
template<SimdTupleOrArithmeticType S, SimdOrTupleType T, SimdTupleOrArithmeticType U, SimdTupleOrArithmeticType V>
auto SumOfProducts (const S &v1, const T &v2, const U &v3, const V &v4) noexcept
 Calculates the sum of the product of the first and the second argument, and the product of the third and fourth argument.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, SimdOrTupleType W>
requires IsCompatible<S, T>&& IsCompatible<S, U>&& IsCompatible<S, V>&& IsCompatible<S, W>
auto BaryCentric (const S &p1, const T &p2, const U &p3, const V &f, const W &g) noexcept
 Calculates a point in Barycentric coordinates, using the specified triangle. https://en.wikipedia.org/wiki/Barycentric_coordinate_system.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, ArithmeticType V, ArithmeticType W>
requires IsCompatible<S, T, U>
auto BaryCentric (const S &p1, const T &p2, const U &p3, const V f, const W g) noexcept
 Calculates a point in Barycentric coordinates, using the specified triangle. https://en.wikipedia.org/wiki/Barycentric_coordinate_system.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, SimdOrTupleType W>
requires IsCompatible<S, T, U, V, W>
CatmullRom (const S &p1, const T &p2, const U &p3, const V &p4, const W &t) noexcept
 Calculates the Catmull-Rom interpolation, using the specified positions.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, ArithmeticType W>
requires IsCompatible<S, T, U, V>
auto CatmullRom (const S &p1, const T &p2, const U &p3, const V &p4, const W t) noexcept
 Calculates the Catmull-Rom interpolation, using the specified positions.
 
template<SimdType T>
auto MinComponentValue (const T &v) noexcept
 Retrieves the lowest value held by the argument.
 
template<TupleType T>
constexpr auto MinComponentValue (const T &v) noexcept
 Retrieves the lowest value held by the argument.
 
template<SimdType T>
auto MaxComponentValue (const T &v) noexcept
 Retrieves the highest value held by the argument.
 
template<TupleType T>
constexpr auto MaxComponentValue (const T &v) noexcept
 Retrieves the highest value held by the argument.
 
template<TupleType T>
constexpr size_t MaxComponentIndex (const T &v) noexcept
 Retrieves the offset of the highest value held by the argument.
 
template<TupleType T>
constexpr size_t MinComponentIndex (const T &v) noexcept
 Retrieves the offset of the lowest value held by the argument.
 
template<SimdType T, typename ResultT = typename T::value_type>
constexpr size_t MinComponentIndex (const T &v) noexcept
 Retrieves the offset of the lowest value held by the argument.
 
template<SimdOrTupleType T>
auto NextUp (const T &t) noexcept
 
template<SimdOrTupleType T>
auto NextDown (const T &t) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
AddAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
AddAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd AddAdjustUp (const S &a, const T &b) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
AddAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
AddAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd AddAdjustDown (const S &a, const T &b) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
SubAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
SubAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd SubAdjustUp (const S &a, const T &b) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
SubAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
SubAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd SubAdjustDown (const S &a, const T &b) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
MulAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
MulAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd MulAdjustUp (const S &a, const T &b) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
MulAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
MulAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd MulAdjustDown (const S &a, const T &b) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
DivAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
DivAdjustUp (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd DivAdjustUp (const S &a, const T &b) noexcept
 
template<SimdType S, SimdType T>
requires IsCompatible<S, T>
DivAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, SimdType T>
requires IsCompatible<S, T>
DivAdjustDown (const S &a, const T &b) noexcept
 
template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd DivAdjustDown (const S &a, const T &b) noexcept
 
template<SimdType S>
SqrtAdjustUp (const S &v) noexcept
 
template<TupleType S>
S::Simd SqrtAdjustUp (const S &v) noexcept
 
template<SimdType S>
SqrtAdjustDown (const S &v) noexcept
 
template<TupleType S>
S::Simd SqrtAdjustDown (const S &v) noexcept
 
template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustUp (NumberT a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustUp (NumberT a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT FMAAdjustUp (NumberT a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustUp (const T &a, NumberT b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustUp (const T &a, NumberT b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT FMAAdjustUp (const T &a, NumberT b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
FMAAdjustUp (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdType S, TupleType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
FMAAdjustUp (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdType S, TupleType T, TupleType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
FMAAdjustUp (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<TupleType S, TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires IsCompatible<S, T>&& IsCompatible<T, U>
ResultT FMAAdjustUp (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustDown (NumberT a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustDown (NumberT a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT FMAAdjustDown (NumberT a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustDown (const T &a, NumberT b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
FMAAdjustDown (const T &a, NumberT b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT FMAAdjustDown (const T &a, NumberT b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
FMAAdjustDown (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdType S, TupleType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
FMAAdjustDown (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<SimdType S, TupleType T, TupleType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
FMAAdjustDown (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<TupleType S, TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires IsCompatible<S, T>&& IsCompatible<T, U>
ResultT FMAAdjustDown (const S &a, const T &b, const U &c) noexcept
 Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.
 
template<VectorOrVectorSimdType S, VectorOrVectorSimdType T>
requires IsCompatible<S, T>
auto AngleBetween (const S &v1, const T &v2) noexcept
 Calculates the angle in radians between two vectors.
 
template<VectorOrVectorSimdType S, VectorOrVectorSimdType T>
requires IsCompatible<S, T>
auto AngleBetweenNormalized (const S &v1, const T &v2) noexcept
 Calculates the angle in radians between two normalized vectors.
 
Point2f InvertBilinear (const Point2f &p, const std::array< Point2f, 4 > &vert)
 
template<PointOrPointSimdType S, PointOrPointSimdType T, PointOrPointSimdType U>
requires IsCompatible<S, T>&& IsCompatible<S, U>
auto LinePointDistance (const S &linePoint1, const T &linePoint2, const U &point) noexcept
 Calculates the minimum distance between a line and a point.
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto operator+ (const T &q1, const U &q2) noexcept
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto operator- (const T &q1, const U &q2) noexcept
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto operator* (const T &q1, const U &q2) noexcept
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto Dot (const T &q1, const U &q2) noexcept
 Calculates the dot product of two quaternions.
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto ScalarDot (const T &q1, const U &q2) noexcept
 Calculates the dot product of two quaternions.
 
template<QuaternionOrQuaternionSimdType T>
auto Conjugate (const T &q) noexcept
 Calculates the conjugate of a quaternion.
 
template<QuaternionOrQuaternionSimdType T>
auto Inverse (const T &q) noexcept
 Calculates the inverse of a quaternion.
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U, SimdOrTupleType V>
requires IsCompatibleQuaternion<T, U> && ( V::Size == 4 )
auto Slerp (const T &q1, const U &q2, const V &t) noexcept
 Spherical linear interpolation between two unit quaternions.
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U, ArithmeticType V>
requires IsCompatibleQuaternion<T, U>
auto Slerp (const T &q1, const U &q2, const V t) noexcept
 Spherical linear interpolation between two unit quaternions.
 
template<SimdOrTupleType S, QuaternionOrQuaternionSimdType T>
requires ( S::Size == 3 )
auto Rotate (const S &v, const T &rotationQuaternion)
 Rotates a vector using a quaternion.
 
template<SimdOrTupleType S, QuaternionOrQuaternionSimdType T>
requires ( S::Size == 3 )
InverseRotate (const S &v, const T &rotationQuaternion)
 Rotates a vector using the inverse of a quaternion.
 
template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U> && ( T::Size == 3 )
auto ShortestArc (const T &fromDir, const U &toDir) noexcept
 Creates the shortest-arc rotation between two directions.
 
template<SimdType T, SimdType U>
requires IsCompatible<T, U>
constexpr auto ScalarAngleBetween (const T &v1, const U &v2)
 
template<typename DerivedT , typename FloatT >
constexpr FloatT ScalarAngleBetween (const Tuple3< DerivedT, FloatT > &v1, const Tuple3< DerivedT, FloatT > &v2)
 
template<typename DerivedT , typename FloatT >
Tuple3< DerivedT, FloatT > AngleBetween (const Tuple3< DerivedT, FloatT > &v1, const Tuple3< DerivedT, FloatT > &v2)
 
template<SquareMatrixSimdType T1, SquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>
auto operator+ (const T1 &m1, const T2 &m2) noexcept
 
template<SquareMatrixOrSquareMatrixSimdType T1, SquareMatrixOrSquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>&& Internal::HasSquareMatrixType<T1, T2>
auto operator+ (const T1 &m1, const T2 &m2) noexcept
 
template<SquareMatrixSimdType T1, SquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>
auto operator- (const T1 &m1, const T2 &m2) noexcept
 
template<SquareMatrixOrSquareMatrixSimdType T1, SquareMatrixOrSquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>&& Internal::HasSquareMatrixType<T1, T2>
auto operator- (const T1 &m1, const T2 &m2) noexcept
 
template<SquareMatrixSimdType T1, ArithmeticType T2>
auto operator* (const T1 &m, const T2 value) noexcept
 
template<ArithmeticType T1, SquareMatrixSimdType T2>
auto operator* (const T1 value, const T2 &m) noexcept
 
SquareMatrix< float, 4 >::Simd Multiply (const typename SquareMatrix< float, 4 >::Simd &matrix1, const typename SquareMatrix< float, 4 >::Simd &matrix2)
 
SquareMatrix< float, 3 >::Simd Multiply (const typename SquareMatrix< float, 3 >::Simd &matrix1, const typename SquareMatrix< float, 3 >::Simd &matrix2)
 
SquareMatrix< float, 2 >::Simd Multiply (const typename SquareMatrix< float, 2 >::Simd &matrix1, const typename SquareMatrix< float, 2 >::Simd &matrix2)
 
template<SquareMatrixSimdType T1, SquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>
T2 operator* (const T1 &m1, const T2 &m2) noexcept
 
template<SquareMatrixOrSquareMatrixSimdType T1, SquareMatrixOrSquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>&& Internal::HasSquareMatrixType<T1, T2>
T2 operator* (const T1 &m1, const T2 &m2) noexcept
 
template<SquareMatrixSimdType T1, ArithmeticType T2>
auto operator/ (const T1 &m, const T2 value) noexcept
 
Vector< float, 4 >::Simd Determinant (const typename SquareMatrix< float, 4 >::Simd &matrix)
 Calculates the determinant of a matrix.
 
Vector< float, 4 >::Simd Determinant (const SquareMatrix< float, 4ULL > &matrix)
 Calculates the determinant of a matrix.
 
float ScalarDeterminant (const SquareMatrix< float, 4 >::Simd &matrix)
 Calculates the determinant of a matrix.
 
float ScalarDeterminant (const SquareMatrix< float, 4 > &matrix)
 Calculates the determinant of a matrix.
 
Vector< float, 3 >::Simd Determinant (const typename SquareMatrix< float, 3 >::Simd &matrix)
 
Vector< float, 3 >::Simd Determinant (const typename SquareMatrix< float, 3 > &matrix)
 
float ScalarDeterminant (const SquareMatrix< float, 3 >::Simd &matrix)
 
float ScalarDeterminant (const SquareMatrix< float, 3 > &matrix)
 
SquareMatrix< float, 3 >::Simd Transpose (const SquareMatrix< float, 3 >::Simd &matrix)
 
SquareMatrix< float, 3 >::Simd Transpose (const SquareMatrix< float, 3 > &matrix)
 
SquareMatrix< float, 4 >::Simd Transpose (const SquareMatrix< float, 4 >::Simd &matrix)
 Calculates the transpose of the matrix.
 
SquareMatrix< float, 4 >::Simd Transpose (const SquareMatrix< float, 4 > &matrix)
 Calculates the transpose of the matrix.
 
SquareMatrix< float, 4 >::Simd Inverse (const SquareMatrix< float, 4 >::Simd &matrix, typename Vector< float, 4 >::Simd *determinant=nullptr)
 Calculates the inverse of the matrix.
 
SquareMatrix< float, 4 >::Simd Inverse (const SquareMatrix< float, 4 > &matrix, typename Vector< float, 4 >::Simd *determinant=nullptr)
 Calculates the inverse of the matrix.
 
SquareMatrix< float, 3 >::Simd Inverse (const typename SquareMatrix< float, 3 >::Simd &matrix, typename Vector< float, 3 >::Simd *determinant=nullptr)
 
SquareMatrix< float, 3 >::Simd Inverse (const SquareMatrix< float, 3 > &matrix, typename Vector< float, 3 >::Simd *determinant=nullptr)
 
SquareMatrix< float, 2 >::Simd Transpose (const typename SquareMatrix< float, 2 >::Simd &matrix)
 
SquareMatrix< float, 2 >::Simd Transpose (const SquareMatrix< float, 2 > &matrix)
 
Vector< float, 2 >::Simd Determinant (const typename SquareMatrix< float, 2 >::Simd &matrix)
 
Vector< float, 2 >::Simd Determinant (const SquareMatrix< float, 2 > &matrix)
 
SquareMatrix< float, 2 >::Simd Inverse (const typename SquareMatrix< float, 2 >::Simd &matrix, typename SquareMatrix< float, 2 >::Simd *determinant=nullptr)
 
SquareMatrix< float, 2 >::Simd Inverse (const SquareMatrix< float, 2 > &matrix)
 
SquareMatrix< float, 4 >::Simd Translation (float offsetX, float offsetY, float offsetZ)
 Creates a translation matrix using the provided offsets.
 
template<SimdType S>
requires ( S::Size > 2 ) && std::is_same_v<typename S::value_type, float>
SquareMatrix< float, 4 >::Simd Translation (const S &offsets)
 Creates a translation matrix using the provided offsets.
 
SquareMatrix< float, 3 >::Simd Translation (float offsetX, float offsetY)
 
SquareMatrix< float, 4 >::Simd Scaling (float scaleX, float scaleY, float scaleZ)
 Creates a transformation matrix for scaling along the x-axis, y-axis, and z-axis.
 
SquareMatrix< float, 4 >::Simd Scaling (float scale)
 Creates a transformation matrix for scaling along the x-axis, y-axis, and z-axis.
 
template<SimdType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd Scaling (const S &v) noexcept
 Creates a transformation matrix for scaling along the x-axis, y-axis, and z-axis.
 
SquareMatrix< float, 3 >::Simd Scaling (float scaleX, float scaleY)
 
template<SimdType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd Rotation (const S &v) noexcept
 Creates a transformation matrix that rotates about the y-axis, then the x-axis, and finally the z-axis.
 
SquareMatrix< float, 4 >::Simd Rotation (float xAxisRotation, float yAxisRotation, float zAxisRotation) noexcept
 Creates a transformation matrix that rotates about the y-axis, then the x-axis, and finally the z-axis.
 
SquareMatrix< float, 4 >::Simd RotationX (float angle) noexcept
 Creates a matrix that rotates around the x-axis.
 
SquareMatrix< float, 4 >::Simd RotationY (float angle) noexcept
 Creates a matrix that rotates around the y-axis.
 
SquareMatrix< float, 4 >::Simd RotationZ (float angle) noexcept
 Creates a matrix that rotates around the z-axis.
 
template<SimdType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd RotationNormal (const S &normalizedAxis, float angle) noexcept
 Creates a matrix that rotates around a normalized vector.
 
template<SimdOrTupleType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd RotationAxis (const S &axis, float angle) noexcept
 Creates a matrix that rotates around an arbitrary axis.
 
SquareMatrix< float, 4 >::Simd Rotation (const Quaternion< float >::Simd &q) noexcept
 Creates a rotation matrix from a quaternion.
 
SquareMatrix< float, 4 >::Simd Rotation (const Quaternion< float > &q) noexcept
 Creates a rotation matrix from a quaternion.
 
SquareMatrix< float, 4 >::Simd RotationQuaternion (const Quaternion< float >::Simd &q) noexcept
 Creates a rotation matrix from a quaternion.
 
SquareMatrix< float, 4 >::Simd RotationQuaternion (const Quaternion< float > &q) noexcept
 Creates a rotation matrix from a quaternion.
 
template<PointOrPointSimdType PointT, QuaternionOrQuaternionSimdType QuaternionT, VectorOrVectorSimdType VectorT>
requires ( PointT::Size == 3 ) && ( VectorT::Size == 3 ) && std::is_same_v<typename PointT::value_type, typename QuaternionT::value_type>&& std::is_same_v<typename PointT::value_type, typename VectorT::value_type>
SquareMatrix< typenamePointT::value_type, 4 >::Simd TransformationMatrix (const PointT &scalingOrigin, const QuaternionT &scalingOrientationQuaternion, const VectorT &scaling, const PointT &rotationOrigin, const QuaternionT &rotationQuaternion, const VectorT &translation) noexcept
 Creates a transformation matrix.
 
template<SimdOrTupleType S, SimdOrTupleType T, QuaternionOrQuaternionSimdType U, SimdOrTupleType W>
requires ( S::Size > 2 ) && ( T::Size > 2 ) && ( W::Size > 2 ) && std::is_same_v<typename S::value_type, typename T::value_type>&& std::is_same_v<typename S::value_type, typename U::value_type>&& std::is_same_v<typename S::value_type, typename W::value_type>
SquareMatrix< typenameS::value_type, 4 >::Simd AffineTransformationMatrix (const S &scaling, const T &rotationOrigin, const U &rotationQuaternion, const W &translation) noexcept
 Creates an affine transformation matrix.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U> && ( S::Size == 3 )
SquareMatrix< typenameS::value_type, 4 >::Simd LookTo (const S &cameraPosition, const T &cameraDirection, const U &upDirection) noexcept
 Creates a view matrix using the left-handed coordinate system for the provided camera position, camera direction, and up direction.
 
template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U> && ( S::Size == 3 )
SquareMatrix< typenameS::value_type, 4 >::Simd LookAt (const S &cameraPosition, const T &focusPosition, const U &upDirection) noexcept
 Creates a view matrix using the left-handed coordinate system for the provided camera position, focal point, and up direction.
 
template<typename T >
requires IsFloatingPoint<T>
SquareMatrix< T, 4 >::Simd PerspectiveProjection (T viewWidth, T viewHeight, T nearZ, T farZ) noexcept
 Creates a left-handed perspective projection matrix.
 
template<typename T >
requires IsFloatingPoint<T>
SquareMatrix< T, 4 >::Simd PerspectiveFovProjection (T fovAngleY, T aspectRatio, T nearZ, T farZ) noexcept
 Creates a left-handed perspective projection matrix based on a field of view.
 
Vector< float, 2 >::Simd Transform (const Vector< float, 2 >::Simd &v, const SquareMatrix< float, 3 >::Simd &matrix) noexcept
 Transforms a 2D vector by a matrix.
 
Vector< float, 3 >::Simd Transform (const Vector< float, 3 >::Simd &v, const SquareMatrix< float, 4 >::Simd &matrix) noexcept
 Applies a transformation matrix to a 3D vector.
 
Vector< float, 3 >::Simd Transform (const Vector< float, 3 > &v, const SquareMatrix< float, 4 >::Simd &matrix) noexcept
 Applies a transformation matrix to a 3D vector.
 
Vector< float, 3 >::Simd Transform (const Vector< float, 3 >::Simd &v, const SquareMatrix< float, 4 > &matrix) noexcept
 Applies a transformation matrix to a 3D vector.
 
Vector< float, 3 >::Simd Transform (const Vector< float, 3 > &v, const SquareMatrix< float, 4 > &matrix) noexcept
 Applies a transformation matrix to a 3D vector.
 
Vector< float, 4 >::Simd Transform (const Vector< float, 4 >::Simd &v, const SquareMatrix< float, 4 >::Simd &matrix) noexcept
 
Point2f::Simd Transform (const Point2f::Simd &p, const SquareMatrix< float, 3 >::Simd &matrix) noexcept
 Applies a transformation matrix to a 2D coordinate.
 
Point3f::Simd Transform (const Point3f::Simd &p, const SquareMatrix< float, 4 >::Simd &matrix) noexcept
 Applies a transformation matrix to a 3D coordinate.
 
Point3f::Simd Transform (const Point3f &p, const SquareMatrix< float, 4 >::Simd &matrix) noexcept
 Applies a transformation matrix to a 3D coordinate.
 
Point3f::Simd Transform (const Point3f::Simd &p, const SquareMatrix< float, 4 > &matrix) noexcept
 Applies a transformation matrix to a 3D coordinate.
 
Point3f::Simd Transform (const Point3f &p, const SquareMatrix< float, 4 > &matrix) noexcept
 Applies a transformation matrix to a 3D coordinate.
 
Normal3f::Simd Transform (const Normal3f::Simd &n, const SquareMatrix< float, 3 >::Simd &matrix) noexcept
 Applies a transformation matrix to a normal.
 
Normal3f::Simd Transform (const Normal3f::Simd &n, const SquareMatrix< float, 4 >::Simd &matrix) noexcept
 Applies a transformation matrix to a normal.
 
Normal3f::Simd Transform (const Normal3f &n, const SquareMatrix< float, 3 >::Simd &matrix) noexcept
 Applies a transformation matrix to a normal.
 
Normal3f::Simd Transform (const Normal3f::Simd &n, const SquareMatrix< float, 3 > &matrix) noexcept
 Applies a transformation matrix to a normal.
 
Normal3f::Simd Transform (const Normal3f::Simd &n, const SquareMatrix< float, 4 > &matrix) noexcept
 Applies a transformation matrix to a normal.
 
Normal3f::Simd Transform (const Normal3f &n, const SquareMatrix< float, 3 > &matrix) noexcept
 Applies a transformation matrix to a normal.
 
template<SimdType S, typename FloatT = S::value_type, typename MatrixT = typename SquareMatrix<FloatT, 4>::Simd>
Project (const S &v, FloatT viewportX, FloatT viewportY, FloatT viewportWidth, FloatT viewportHeight, FloatT viewportMinZ, FloatT viewportMaxZ, const MatrixT &projection, const MatrixT &viewTransform, const MatrixT &WorldTransform) noexcept
 Projects a 3D coordinate from object space into screen space.
 
bool Decompose (const SquareMatrix< float, 4 >::Simd &matrix, Vector3f::Simd *outScale, Quaternion< float >::Simd *outRotQuat, Vector3f::Simd *outTrans) noexcept
 
template<PlaneSimdType T>
Normalize (const T &plane) noexcept
 
template<PlaneType T>
T::Simd Normalize (const T &plane) noexcept
 
template<PlaneSimdType T>
FastNormalize (const T &plane) noexcept
 
template<PlaneType T>
T::Simd FastNormalize (const T &plane) noexcept
 
template<PlaneSimdType P, VectorSimdType V>
requires std::is_same_v<typename P::value_type, typename V::value_type> && ( V::Size > 2 )
Dot (const P &plane, const V &v)
 
template<PlaneSimdType P, NormalSimdType N>
requires std::is_same_v<typename P::value_type, typename N::value_type> && ( N::Size > 2 )
Dot (const P &plane, const N &normal)
 
template<PlaneSimdType P, PointSimdType PT>
PT Dot (const P &plane, const PT &point)
 
template<Internal::VectorNormalOrPointSimdType T, PlaneSimdType P>
Dot (const T &v, const P &plane)
 
template<PlaneType P, Internal::VectorNormalOrPointType T>
Dot (const P &plane, const T &v)
 
template<PlaneType P, PointSimdType PT>
PT Intersect (const P &plane, const PT &linePoint1, const PT &linePoint2) noexcept
 
std::pair< Point3f::Simd, Point3f::SimdIntersect (const Plane< float >::Simd &plane1, const Plane< float >::Simd &plane2) noexcept
 
Plane< float >::Simd Transform (const Plane< float >::Simd &plane, const SquareMatrix< float, 4 >::Simd &transformationMatrix) noexcept
 
template<typename CharT , size_t N>
auto operator<< (std::basic_ostream< CharT > &os, const SquareMatrix< float, N > &value)
 
constexpr Harlinn::Windows::Point Min (const Harlinn::Windows::Point &first, const Harlinn::Windows::Point &second)
 
constexpr Harlinn::Windows::Point Max (const Harlinn::Windows::Point &first, const Harlinn::Windows::Point &second)
 
constexpr Harlinn::Windows::Graphics::PointF Min (const Harlinn::Windows::Graphics::PointF &first, const Harlinn::Windows::Graphics::PointF &second)
 
constexpr Harlinn::Windows::Graphics::PointF Max (const Harlinn::Windows::Graphics::PointF &first, const Harlinn::Windows::Graphics::PointF &second)
 
constexpr Harlinn::Windows::Size Min (const Harlinn::Windows::Size &first, const Harlinn::Windows::Size &second)
 
constexpr Harlinn::Windows::Size Max (const Harlinn::Windows::Size &first, const Harlinn::Windows::Size &second)
 
constexpr Harlinn::Windows::Graphics::SizeF Min (const Harlinn::Windows::Graphics::SizeF &first, const Harlinn::Windows::Graphics::SizeF &second)
 
constexpr Harlinn::Windows::Graphics::SizeF Max (const Harlinn::Windows::Graphics::SizeF &first, const Harlinn::Windows::Graphics::SizeF &second)
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
constexpr std::remove_cvref_t< T > Clamp (T value, T minimumValue, T maximumValue) noexcept
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
constexpr std::remove_cvref_t< T > Clamp (T value, T minimumValue, T maximumValue) noexcept
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
constexpr std::remove_cvref_t< T > Floor (T value) noexcept
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
constexpr std::remove_cvref_t< T > Floor (T value) noexcept
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
constexpr std::remove_cvref_t< T > Ceil (T value) noexcept
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
constexpr std::remove_cvref_t< T > Ceil (T value) noexcept
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
constexpr std::remove_cvref_t< T > Lerp (T a, T b, T t) noexcept
 
template<typename T , typename U >
requires (Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT> && IsFloatingPoint<U> )
constexpr std::remove_cvref_t< T > Lerp (T a, T b, U t) noexcept
 
template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
constexpr std::remove_cvref_t< T > Lerp (T a, T b, T t) noexcept
 

Variables

template<typename T , typename ... Other>
constexpr bool IsCompatible = ( std::is_same_v<typename T::Traits, typename Other::Traits> && ... )
 
template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType ... Other>
constexpr bool IsCompatibleQuaternion = ( std::is_same_v<typename T::Traits, typename Other::Traits> && ... )
 
template<typename T , typename ... Other>
constexpr bool IsCompatibleMatrix = ( ( std::is_same_v<typename T::Traits, typename Other::Traits> && ( T::Size == Other::Size ) ) && ... )
 
template<PlaneOrPlaneSimdType T, PlaneOrPlaneSimdType ... Other>
constexpr bool IsCompatiblePlane = ( std::is_same_v<typename T::Traits, typename Other::Traits> && ... )
 

Typedef Documentation

◆ Line2

template<FloatingPointType T>
using Harlinn::Math::Line2 = Line<T, 2>

◆ Line2d

using Harlinn::Math::Line2d = Line2<double>

◆ Line2f

using Harlinn::Math::Line2f = Line2<float>

◆ Line3

template<FloatingPointType T>
using Harlinn::Math::Line3 = Line<T, 3>

◆ Line3d

using Harlinn::Math::Line3d = Line3<double>

◆ Line3f

using Harlinn::Math::Line3f = Line3<float>

◆ Normal3f

using Harlinn::Math::Normal3f = Normal<float, 3>

◆ Point2f

using Harlinn::Math::Point2f = Point<float, 2>

◆ Point2i

◆ Point3f

using Harlinn::Math::Point3f = Point<float, 3>

◆ Point3i

◆ Segment2

template<FloatingPointType T>
using Harlinn::Math::Segment2 = Segment<T, 2>

◆ Segment2d

◆ Segment2f

◆ Segment3

template<FloatingPointType T>
using Harlinn::Math::Segment3 = Segment<T, 3>

◆ Segment3d

◆ Segment3f

◆ Vector2d

using Harlinn::Math::Vector2d = Vector<double, 2>

◆ Vector2f

using Harlinn::Math::Vector2f = Vector<float, 2>

◆ Vector2i

◆ Vector3d

using Harlinn::Math::Vector3d = Vector<double, 3>

◆ Vector3f

using Harlinn::Math::Vector3f = Vector<float, 3>

◆ Vector3i

◆ Vector4d

using Harlinn::Math::Vector4d = Vector<double, 4>

◆ Vector4f

using Harlinn::Math::Vector4f = Vector<float, 4>

◆ Vector4i

Enumeration Type Documentation

◆ MatrixType

enum class Harlinn::Math::MatrixType : UInt32
strong
Enumerator
Zero 
Identity 

Function Documentation

◆ Abs() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::Abs ( const Interval< FloatT > & i)
inline

◆ Abs() [2/3]

template<SimdOrTupleType T>
auto Harlinn::Math::Abs ( const T & t)
inlinenoexcept

Computes the absolute value of each element held by the argument.

◆ Abs() [3/3]

template<SignedIntegerType T>
T Harlinn::Math::Abs ( T val)
inlineconstexprnoexcept

The absolute value of any unsigned integer is the same as its value.

Computes the absolute value of a signed integer number. The behavior is undefined if the result cannot be represented by the return type.

In 2's complement systems, the absolute value of the most-negative value is out of range, e.g. for 32-bit 2's complement type int, INT_MIN is -2147483648, but the would-be result 2147483648 is greater than INT_MAX, which is 2147483647.

Template Parameters
TAny signed integer type.
Parameters
valA signed integer value.
Returns
The absolute value of val.
Template Parameters
TAny unsigned integer type.
Parameters
valAn unsigned integer value.
Returns
val without any modification.

Computes the absolute value of a floating point value.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
Returns
The absolute value of val.

◆ abs()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::abs ( const Interval< FloatT > & i)
inline

◆ AbsDot()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::AbsDot ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the absolute value of the dot product between v1 and v2.

◆ ACos() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::ACos ( const Interval< FloatT > & i)
inline

◆ ACos() [2/3]

template<SimdOrTupleType T>
auto Harlinn::Math::ACos ( const T & v)
inlinenoexcept

Calculates the inverse cosine of each element in the argument, in radians.

◆ ACos() [3/3]

template<FloatingPointType T>
T Harlinn::Math::ACos ( T x)
inlineconstexprnoexcept

Computes the value of the arc cosine of x.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The principal value of the arc cosine of x.

◆ ACosH() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::ACosH ( const T & v)
inlinenoexcept

Calculates the inverse hyperbolic cosine of each element in the argument, in radians.

◆ ACosH() [2/2]

template<FloatingPointType T>
T Harlinn::Math::ACosH ( T x)
inlineconstexprnoexcept

Calculates the inverse hyperbolic cosine of x.

◆ AddAdjustDown() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::AddAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ AddAdjustDown() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::AddAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ AddAdjustDown() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::AddAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ AddAdjustDown() [4/4]

template<FloatingPointType T>
T Harlinn::Math::AddAdjustDown ( T a,
T b )
inlineconstexpr

◆ AddAdjustUp() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::AddAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ AddAdjustUp() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::AddAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ AddAdjustUp() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::AddAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ AddAdjustUp() [4/4]

template<FloatingPointType T>
T Harlinn::Math::AddAdjustUp ( T a,
T b )
inlineconstexpr

◆ AddAngles()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::AddAngles ( const T & v1,
const U & v2 )
inlinenoexcept

Adds the angles in the corresponding elements of v1 and v2. The argument angles must be in the range [-PI,PI), and the computed angles will be in the range [-PI,PI)

◆ AffineTransformationMatrix()

template<SimdOrTupleType S, SimdOrTupleType T, QuaternionOrQuaternionSimdType U, SimdOrTupleType W>
requires ( S::Size > 2 ) && ( T::Size > 2 ) && ( W::Size > 2 ) && std::is_same_v<typename S::value_type, typename T::value_type>&& std::is_same_v<typename S::value_type, typename U::value_type>&& std::is_same_v<typename S::value_type, typename W::value_type>
SquareMatrix< typenameS::value_type, 4 >::Simd Harlinn::Math::AffineTransformationMatrix ( const S & scaling,
const T & rotationOrigin,
const U & rotationQuaternion,
const W & translation )
inlinenoexcept

Creates an affine transformation matrix.

Parameters
scalingThe scaling factors for each dimension.
rotationOriginThe center of rotation.
rotationQuaternionRotation factors as a quaternion.
translationThe translation offsets.
Returns

◆ AllEqual() [1/5]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
bool Harlinn::Math::AllEqual ( const S & lhs,
const T & rhs,
const U & epsilon )
inlinenoexcept

Determines whether all the elements of lhs and their corresponding element of rhs are less or equally apart than the corresponding element of epsilon.

Parameters
lhsThe first source of values for the comparison.
rhsThe second source of values for the comparison.
epsilonThe source of the maximum difference between the corresponding elements from lhs and rhs.
Returns
true if all the elements of lhs and the corresponding elements of rhs are less or equally apart than the corresponding element of epsilon, otherwise false.

◆ AllEqual() [2/5]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
bool Harlinn::Math::AllEqual ( const S & lhs,
const T & rhs,
const U epsilon )
inlinenoexcept

Determines whether all the elements of lhs and their corresponding element of rhs are less or equally apart than the value of epsilon.

Parameters
lhsThe first source of values for the comparison.
rhsThe second source of values for the comparison.
epsilonThe maximum difference between the elements from lhs and rhs.
Returns
true if all the elements of lhs and the corresponding elements of rhs are less or equally apart than the value of epsilon, otherwise false.

◆ AllEqual() [3/5]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AllEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether all the elements of v1 are equal to the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if all the elements of v1 is equal to their corresponding element in v2, otherwise false.

◆ AllEqual() [4/5]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AllEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether all the elements of v1 are equal to value.

Returns
true if all the elements of v1 is equal to value, otherwise false.

◆ AllEqual() [5/5]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AllEqual ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is equal to all the elements of v2.

Returns
true value is equal to all the elements of v2, otherwise false.

◆ AllGreater() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AllGreater ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether all the elements of v1 are greater than the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if all the elements of v1 is greater than their corresponding element in v2, otherwise false.

◆ AllGreater() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AllGreater ( const T & v1,
U value )
inlinenoexcept

Determines whether all the elements of v1 are greater than value.

Returns
true if all the elements of v1 is greater than value, otherwise false.

◆ AllGreater() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AllGreater ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is greater than all of the elements of v2.

Returns
true value is greater than any of the elements of v2, otherwise false.

◆ AllGreaterOrEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AllGreaterOrEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether all the elements of v1 are greater than, or equal to, the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if all the elements of v1 is greater than, or equal to, their corresponding element in v2, otherwise false.

◆ AllGreaterOrEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AllGreaterOrEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether all the elements of v1 are greater than, or equal to, value.

Returns
true if all the elements of v1 is greater than, or equal to, value, otherwise false.

◆ AllGreaterOrEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AllGreaterOrEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is greater than, or equal to, all of the elements of v2.

Returns
true value is greater than, or equal to, any of the elements of v2, otherwise false.

◆ AllLess() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AllLess ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether all the elements of v1 are less than the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if all the elements of v1 is less than their corresponding element in v2, otherwise false.

◆ AllLess() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AllLess ( const T & v1,
U value )
inlinenoexcept

Determines whether all the elements of v1 are less than value.

Returns
true if all the elements of v1 is less than value, otherwise false.

◆ AllLess() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AllLess ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is less than all of the elements of v2.

Returns
true value is less than any of the elements of v2, otherwise false.

◆ AllLessOrEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AllLessOrEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether all the elements of v1 are less than, or equal to, the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if all the elements of v1 is less than, or equal to, their corresponding element in v2, otherwise false.

◆ AllLessOrEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AllLessOrEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether all the elements of v1 are less than, or equal to, value.

Returns
true if all the elements of v1 is less than, or equal to, value, otherwise false.

◆ AllLessOrEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AllLessOrEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is less than, or equal to, all of the elements of v2.

Returns
true value is less than, or equal to, any of the elements of v2, otherwise false.

◆ AllNotEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AllNotEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether all the elements of v1 are not equal to the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if all the elements of v1 is not equal to their corresponding element in v2, otherwise false.

◆ AllNotEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AllNotEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether all the elements of v1 are not equal to value.

Returns
true if all the elements of v1 is not equal to value, otherwise false.

◆ AllNotEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AllNotEqual ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is not equal to all the elements of v2.

Returns
true value is not equal to all the elements of v2, otherwise false.

◆ AllTrue()

template<SimdOrTupleType T>
bool Harlinn::Math::AllTrue ( const T & v)
inlinenoexcept

Returns true if all the elements of the argument have all their bits set to 1.

◆ AngleBetween() [1/2]

template<VectorOrVectorSimdType S, VectorOrVectorSimdType T>
requires IsCompatible<S, T>
auto Harlinn::Math::AngleBetween ( const S & v1,
const T & v2 )
inlinenoexcept

Calculates the angle in radians between two vectors.

Parameters
v1The first vector.
v2The second vector.
Returns
A vector where with each element set to the angle between the two argument vectors.

◆ AngleBetween() [2/2]

template<typename DerivedT , typename FloatT >
Tuple3< DerivedT, FloatT > Harlinn::Math::AngleBetween ( const Tuple3< DerivedT, FloatT > & v1,
const Tuple3< DerivedT, FloatT > & v2 )
inline

◆ AngleBetweenNormalized()

template<VectorOrVectorSimdType S, VectorOrVectorSimdType T>
requires IsCompatible<S, T>
auto Harlinn::Math::AngleBetweenNormalized ( const S & v1,
const T & v2 )
inlinenoexcept

Calculates the angle in radians between two normalized vectors.

Parameters
v1The first normalized vector.
v2

The second normalized vector.

Returns
A vector where with each element set to the angle between the two argument vectors.

◆ AnyEqual() [1/5]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
bool Harlinn::Math::AnyEqual ( const S & lhs,
const T & rhs,
const U & epsilon )
inlinenoexcept

Determines whether any of the elements of lhs and their corresponding element of rhs are less or equally apart than the corresponding element of epsilon.

Parameters
lhsThe first source of values for the comparison.
rhsThe second source of values for the comparison.
epsilonThe source of the maximum difference between the corresponding elements from lhs and rhs.
Returns
true if any of the elements of lhs and the corresponding elements of rhs are less or equally apart than the corresponding element of epsilon, otherwise false.

◆ AnyEqual() [2/5]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
bool Harlinn::Math::AnyEqual ( const S & lhs,
const T & rhs,
U epsilon )
inlinenoexcept

Determines whether any of the elements of lhs and their corresponding element of rhs are less or equally apart than the value of epsilon.

Parameters
lhsThe first source of values for the comparison.
rhsThe second source of values for the comparison.
epsilonThe maximum difference between the elements from lhs and rhs.
Returns
true if any of the elements of lhs and the corresponding elements of rhs are less or equally apart than the value of epsilon, otherwise false.

◆ AnyEqual() [3/5]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AnyEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether any of the elements of v1 are equal to the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if any of the elements of v1 is equal to their corresponding element in v2, otherwise false.

◆ AnyEqual() [4/5]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AnyEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether any of the elements of v1 are equal to value.

Returns
true if any of the elements of v1 is equal to value, otherwise false.

◆ AnyEqual() [5/5]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AnyEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is equal to any of the elements of v2.

Returns
true value is equal to any of the elements of v2, otherwise false.

◆ AnyGreater() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AnyGreater ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether any of the elements of v1 are greater than the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if any of the elements of v1 is greater than their corresponding element in v2, otherwise false.

◆ AnyGreater() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AnyGreater ( const T & v1,
U value )
inlinenoexcept

Determines whether any of the elements of v1 are greater than value.

Returns
true if any of the elements of v1 is greater than value, otherwise false.

◆ AnyGreater() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AnyGreater ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is greater than any of the elements of v2.

Returns
true value is greater than any of the elements of v2, otherwise false.

◆ AnyGreaterOrEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AnyGreaterOrEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether any of the elements of v1 are greater than, or equal to, the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if any of the elements of v1 is greater than, or equal to, their corresponding element in v2, otherwise false.

◆ AnyGreaterOrEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AnyGreaterOrEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether any of the elements of v1 are greater than, or equal to, value.

Returns
true if any of the elements of v1 is greater than, or equal to, value, otherwise false.

◆ AnyGreaterOrEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AnyGreaterOrEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is greater than, or equal to, any of the elements of v2.

Returns
true value is greater than, or equal to, any of the elements of v2, otherwise false.

◆ AnyLess() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AnyLess ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether any of the elements of v1 are less than the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if any of the elements of v1 is less than their corresponding element in v2, otherwise false.

◆ AnyLess() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AnyLess ( const T & v1,
U value )
inlinenoexcept

Determines whether any of the elements of v1 are less than value.

Returns
true if any of the elements of v1 is less than value, otherwise false.

◆ AnyLess() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AnyLess ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is less than any of the elements of v2.

Returns
true value is less than any of the elements of v2, otherwise false.

◆ AnyLessOrEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AnyLessOrEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether any of the elements of v1 are less than, or equal to, the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if any of the elements of v1 is less than, or equal to, their corresponding element in v2, otherwise false.

◆ AnyLessOrEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AnyLessOrEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether any of the elements of v1 are less than, or equal to, value.

Returns
true if any of the elements of v1 is less than, or equal to, value, otherwise false.

◆ AnyLessOrEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AnyLessOrEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is less than, or equal to, any of the elements of v2.

Returns
true value is less than, or equal to, any of the elements of v2, otherwise false.

◆ AnyNotEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
bool Harlinn::Math::AnyNotEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether any of the elements of v1 are not equal to the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
true if any of the elements of v1 is not equal to their corresponding element in v2, otherwise false.

◆ AnyNotEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
bool Harlinn::Math::AnyNotEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether any of the elements of v1 are not equal to value.

Returns
true if any of the elements of v1 is not equal to value, otherwise false.

◆ AnyNotEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
bool Harlinn::Math::AnyNotEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is not equal to any of the elements of v2.

Returns
true value is not equal to any of the elements of v2, otherwise false.

◆ AnyTrue()

template<SimdOrTupleType T>
bool Harlinn::Math::AnyTrue ( const T & v)
inlinenoexcept

Returns true if any of the elements of the argument have all their bits set to 1.

◆ ASin() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::ASin ( const T & v)
inlinenoexcept

Calculates the inverse sine of each element in the argument, in radians.

◆ ASin() [2/2]

template<FloatingPointType T>
T Harlinn::Math::ASin ( T x)
inlineconstexprnoexcept

Computes the value of the arc sine of x.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The principal value of the arc sine of x.

◆ ASinH() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::ASinH ( const T & v)
inlinenoexcept

Calculates the inverse hyperbolic sine of each element in the argument, in radians.

◆ ASinH() [2/2]

template<FloatingPointType T>
T Harlinn::Math::ASinH ( T x)
inlineconstexprnoexcept

Calculates the inverse hyperbolic sine of x.

◆ ATan() [1/3]

template<SimdOrTupleType T>
auto Harlinn::Math::ATan ( const T & v)
inlinenoexcept

Calculates the inverse tangent of each element in the argument, in radians.

◆ ATan() [2/3]

template<FloatingPointType T>
T Harlinn::Math::ATan ( T x)
inlineconstexprnoexcept

Computes the value of the arc tangent of x.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The principal value of the arc tangent of x.

◆ ATan() [3/3]

template<FloatingPointType T>
T Harlinn::Math::ATan ( T y,
T x )
inlineconstexprnoexcept

arc tangent of y / x using the signs of arguments to determine the correct quadrant.

Template Parameters
TA floating point type.
Parameters
yA floating point value.
cA floating point value.
Returns
The arc tangent of y / x using the signs of arguments to determine the correct quadrant.

◆ ATan2() [1/2]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::ATan2 ( const T & x,
const U & y )
inlinenoexcept

Calculates the inverse tangent of each element in x divided by the corresponding element in y, in radians.

◆ ATan2() [2/2]

template<FloatingPointType T>
T Harlinn::Math::ATan2 ( T y,
T x )
inlineconstexprnoexcept

The arc tangent of y / x using the signs of arguments to determine the correct quadrant.

Template Parameters
TA floating point type.
Parameters
yA floating point value.
xA floating point value.
Returns
The arc tangent of y / x using the signs of arguments to determine the correct quadrant.

◆ ATanH() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::ATanH ( const T & v)
inlinenoexcept

Calculates the inverse hyperbolic tangent of each element in the argument, in radians.

◆ ATanH() [2/2]

template<FloatingPointType T>
T Harlinn::Math::ATanH ( T x)
inlineconstexprnoexcept

Calculates the inverse hyperbolic tangent of x.

◆ Avg()

template<SimdType T>
auto Harlinn::Math::Avg ( const T & t)
inlinenoexcept

◆ BaryCentric() [1/2]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, SimdOrTupleType W>
requires IsCompatible<S, T>&& IsCompatible<S, U>&& IsCompatible<S, V>&& IsCompatible<S, W>
auto Harlinn::Math::BaryCentric ( const S & p1,
const T & p2,
const U & p3,
const V & f,
const W & g )
inlinenoexcept

Calculates a point in Barycentric coordinates, using the specified triangle. https://en.wikipedia.org/wiki/Barycentric_coordinate_system.

Parameters
p1The first position.
p2The second position.
p3The third position.
fWeighting factor.
gWeighting factor.

◆ BaryCentric() [2/2]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, ArithmeticType V, ArithmeticType W>
requires IsCompatible<S, T, U>
auto Harlinn::Math::BaryCentric ( const S & p1,
const T & p2,
const U & p3,
const V f,
const W g )
inlinenoexcept

Calculates a point in Barycentric coordinates, using the specified triangle. https://en.wikipedia.org/wiki/Barycentric_coordinate_system.

Parameters
p1The first position.
p2The second position.
p3The third position.
fWeighting factor.
gWeighting factor.

◆ CatmullRom() [1/2]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, SimdOrTupleType W>
requires IsCompatible<S, T, U, V, W>
S Harlinn::Math::CatmullRom ( const S & p1,
const T & p2,
const U & p3,
const V & p4,
const W & t )
inlinenoexcept

Calculates the Catmull-Rom interpolation, using the specified positions.

Parameters
p1The first position.
p2The second position.
p3The third position.
p4The fourth position.
tThe interpolation control factors.

◆ CatmullRom() [2/2]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, ArithmeticType W>
requires IsCompatible<S, T, U, V>
auto Harlinn::Math::CatmullRom ( const S & p1,
const T & p2,
const U & p3,
const V & p4,
const W t )
inlinenoexcept

Calculates the Catmull-Rom interpolation, using the specified positions.

Parameters
p1The first position.
p2The second position.
p3The third position.
p4The fourth position.
tThe interpolation control factors.

◆ Cbrt() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Cbrt ( const T & v)
inlinenoexcept

Calculates the cube root of each element in the argument.

◆ Cbrt() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Cbrt ( T x)
inlineconstexprnoexcept

◆ Ceil() [1/5]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::Ceil ( const Interval< FloatT > & i)
inline

◆ Ceil() [2/5]

template<SimdOrTupleType T>
auto Harlinn::Math::Ceil ( const T & t)
inlinenoexcept

Computes the ceiling of each element held by the argument.

◆ Ceil() [3/5]

template<FloatingPointType T>
T Harlinn::Math::Ceil ( T value)
inlineconstexprnoexcept

Just returns value.

Computes the smallest integer value not less than value.

Template Parameters
TA floating point type.
Parameters
valueA floating point value.
Returns
The smallest integer value not less than value.
Template Parameters
TAn integer type.
Parameters
valueAn integer value.
Returns
value

◆ Ceil() [4/5]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
std::remove_cvref_t< T > Harlinn::Math::Ceil ( T value)
inlineconstexprnoexcept

◆ Ceil() [5/5]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
std::remove_cvref_t< T > Harlinn::Math::Ceil ( T value)
inlineconstexprnoexcept

◆ ceil()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::ceil ( const Interval< FloatT > & i)
inline

◆ Clamp() [1/7]

template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::Clamp ( const S & v,
const T & lowerBounds,
const U & upperBounds )
inlinenoexcept

Returns the elements of v, if the elements are between their respective boundaries specified by the elements of lowerBounds and the elements of upperBounds, otherwise the value of nearest boundary is returned.

◆ Clamp() [2/7]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto Harlinn::Math::Clamp ( const S & v,
const T & lowerBounds,
const U & upperBounds )
inlinenoexcept

Returns the elements of v, if the elements are between their respective boundaries specified by the elements of lowerBounds and the elements of upperBounds, otherwise the value of nearest boundary is returned.

◆ Clamp() [3/7]

template<SimdType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::Clamp ( const S & v,
const T lowerBounds,
const U upperBounds )
inlinenoexcept

Returns the elements of v, if the elements are between their respective boundaries specified by lowerBounds and upperBounds, otherwise the value of nearest boundary is returned.

◆ Clamp() [4/7]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Clamp ( const S v,
const T & lowerBounds,
const U & upperBounds )
inlinenoexcept

Returns the elements of v, if the elements are between their respective boundaries specified by the elements of lowerBounds and the elements of upperBounds, otherwise the value of nearest boundary is returned.

◆ Clamp() [5/7]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
std::remove_cvref_t< T > Harlinn::Math::Clamp ( T value,
T minimumValue,
T maximumValue )
inlineconstexprnoexcept

◆ Clamp() [6/7]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
std::remove_cvref_t< T > Harlinn::Math::Clamp ( T value,
T minimumValue,
T maximumValue )
inlineconstexprnoexcept

◆ Clamp() [7/7]

template<ArithmeticType T1, ArithmeticType T2, ArithmeticType T3>
T1 Harlinn::Math::Clamp ( T1 value,
T2 minimumValue,
T3 maximumValue )
inlineconstexprnoexcept

If the value is within [minimumValue, maximumValue], the function returns value, otherwise returns the nearest boundary.

Template Parameters
TAny type that supports the < operator.
Parameters
value The value to clamp.
minimumValue The lower boundary.
maximumValue The upper boundary.
Returns
The value within [minimumValue, maximumValue], or the nearest boundary.

◆ ClampLength() [1/2]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::ClampLength ( const S & v,
const T & lengthMin,
const U & lengthMax )
inlinenoexcept

Clamps the length of a vector to a given range.

Parameters
vvector to clamp.
lengthMinA vector whose elements are equal to the minimum clamp length. The elements must be greater-than-or-equal to zero.
lengthMaxA vector whose elements are equal to the maximum clamp length. The elements must be greater-than-or-equal to zero.
Returns
Returns a vector whose length is clamped to the specified minimum and maximum.

◆ ClampLength() [2/2]

template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::ClampLength ( const S & v,
const T lengthMin,
const U lengthMax )
inlinenoexcept

Clamps the length of a vector to a given range.

Parameters
vvector to clamp.
lengthMinMinimum clamp length.
lengthMaxMaximum clamp length.
Returns
Returns a vector whose length is clamped to the specified minimum and maximum.

◆ ClampZero()

template<SimdOrTupleType S>
auto Harlinn::Math::ClampZero ( const S & v)
inlinenoexcept

◆ Conjugate()

template<QuaternionOrQuaternionSimdType T>
auto Harlinn::Math::Conjugate ( const T & q)
noexcept

Calculates the conjugate of a quaternion.

Parameters
qThe quaternion.
Returns
The conjugate of the quaternion

◆ CopySign()

template<FloatingPointType T>
T Harlinn::Math::CopySign ( T magnitude,
T signValue )
inlineconstexprnoexcept

Composes a floating point value with the magnitude of magnitude and the sign of signValue.

Template Parameters
TA floating point type.
Parameters
magnitudeA floating point value.
signValueA floating point value.
Returns
A floating point value with the magnitude of magnitude and the sign of signValue.

◆ Cos() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::Cos ( const Interval< FloatT > & i)
inline

◆ Cos() [2/3]

template<SimdOrTupleType T>
auto Harlinn::Math::Cos ( const T & v)
inlinenoexcept

Calculates the cosine of each element in the argument expressed in radians.

◆ Cos() [3/3]

template<FloatingPointType T>
T Harlinn::Math::Cos ( T x)
inlineconstexprnoexcept

Computes the cosine of x given in radians.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The cosine of x given in radians.

◆ CosH() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::CosH ( const T & v)
inlinenoexcept

Calculates the hyperbolic cosine of each element in the argument expressed in radians.

◆ CosH() [2/2]

template<FloatingPointType T>
T Harlinn::Math::CosH ( T x)
inlineconstexprnoexcept

Calculates the hyperbolic cosine of x.

◆ Cross() [1/2]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Cross ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the cross product between v1 and v2.

◆ Cross() [2/2]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::Cross ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the cross product between v1 and v2.

◆ Decompose()

bool Harlinn::Math::Decompose ( const SquareMatrix< float, 4 >::Simd & matrix,
Vector3f::Simd * outScale,
Quaternion< float >::Simd * outRotQuat,
Vector3f::Simd * outTrans )
inlinenoexcept

◆ Deg2Rad()

template<FloatingPointType T>
T Harlinn::Math::Deg2Rad ( T angleInDegrees)
inlineconstexprnoexcept

Converts an angle in degrees into the corresponding angle in radians.

Template Parameters
TA floating point type.
Parameters
angleInDegreesThe angle in degrees.
Returns
The angle in radians.

◆ Degrees()

template<FloatingPointType T>
T Harlinn::Math::Degrees ( T rad)
inlineconstexpr

◆ Determinant() [1/6]

Vector< float, 2 >::Simd Harlinn::Math::Determinant ( const SquareMatrix< float, 2 > & matrix)
inline

◆ Determinant() [2/6]

Vector< float, 4 >::Simd Harlinn::Math::Determinant ( const SquareMatrix< float, 4ULL > & matrix)
inline

Calculates the determinant of a matrix.

Parameters
matrixThe matrix that the determinant will be calculated for.
Returns
Returns a Vector<float,4>::Simd with all the elements set to the determinant of the matrix.

◆ Determinant() [3/6]

Vector< float, 2 >::Simd Harlinn::Math::Determinant ( const typename SquareMatrix< float, 2 >::Simd & matrix)
inline

◆ Determinant() [4/6]

Vector< float, 3 >::Simd Harlinn::Math::Determinant ( const typename SquareMatrix< float, 3 > & matrix)
inline

◆ Determinant() [5/6]

Vector< float, 3 >::Simd Harlinn::Math::Determinant ( const typename SquareMatrix< float, 3 >::Simd & matrix)
inline

◆ Determinant() [6/6]

Vector< float, 4 >::Simd Harlinn::Math::Determinant ( const typename SquareMatrix< float, 4 >::Simd & matrix)
inline

Calculates the determinant of a matrix.

Parameters
matrixThe matrix that the determinant will be calculated for.
Returns
Returns a Vector<float,4>::Simd with all the elements set to the determinant of the matrix.

◆ DifferenceOfProducts() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::DifferenceOfProducts ( const Interval< FloatT > & a,
const Interval< FloatT > & b,
const Interval< FloatT > & c,
const Interval< FloatT > & d )
inline

◆ DifferenceOfProducts() [2/3]

template<SimdTupleOrArithmeticType S, SimdOrTupleType T, SimdTupleOrArithmeticType U, SimdTupleOrArithmeticType V>
auto Harlinn::Math::DifferenceOfProducts ( const S & v1,
const T & v2,
const U & v3,
const V & v4 )
inlinenoexcept

Calculates the difference between the product of the first and the second argument, and the product of the third and fourth argument.

◆ DifferenceOfProducts() [3/3]

template<typename Ta , typename Tb , typename Tc , typename Td >
requires IsFloatingPoint<Ta>&& IsFloatingPoint<Tb>&& IsFloatingPoint<Tc>&& IsFloatingPoint<Td>
auto Harlinn::Math::DifferenceOfProducts ( Ta a,
Tb b,
Tc c,
Td d )
inlineconstexpr

◆ Distance()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Distance ( const T & p1,
const U & p2 )
inlinenoexcept

Calculates the distance between p1 and p2.

◆ DistanceSquared() [1/2]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::DistanceSquared ( const T & p1,
const U & p2 )
inlinenoexcept

Calculates the squared distance between p1 and p2.

◆ DistanceSquared() [2/2]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::DistanceSquared ( const T & p1,
const U & p2 )
inlinenoexcept

Calculates the squared distance between p1 and p2.

◆ DivAdjustDown() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::DivAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ DivAdjustDown() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::DivAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ DivAdjustDown() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::DivAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ DivAdjustDown() [4/4]

template<FloatingPointType T>
T Harlinn::Math::DivAdjustDown ( T a,
T b )
inlineconstexpr

◆ DivAdjustUp() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::DivAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ DivAdjustUp() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::DivAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ DivAdjustUp() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::DivAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ DivAdjustUp() [4/4]

template<FloatingPointType T>
T Harlinn::Math::DivAdjustUp ( T a,
T b )
inlineconstexpr

◆ Dot() [1/15]

template<PlaneSimdType P, NormalSimdType N>
requires std::is_same_v<typename P::value_type, typename N::value_type> && ( N::Size > 2 )
N Harlinn::Math::Dot ( const P & plane,
const N & normal )
inline

◆ Dot() [2/15]

template<PlaneSimdType P, PointSimdType PT>
PT Harlinn::Math::Dot ( const P & plane,
const PT & point )
inline

◆ Dot() [3/15]

template<PlaneType P, Internal::VectorNormalOrPointType T>
T Harlinn::Math::Dot ( const P & plane,
const T & v )
inline

◆ Dot() [4/15]

template<PlaneSimdType P, VectorSimdType V>
requires std::is_same_v<typename P::value_type, typename V::value_type> && ( V::Size > 2 )
V Harlinn::Math::Dot ( const P & plane,
const V & v )
inline

◆ Dot() [5/15]

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto Harlinn::Math::Dot ( const T & q1,
const U & q2 )
noexcept

Calculates the dot product of two quaternions.

Parameters
q1The first quaternion.
q2The second quaternion.
Returns
The dot product between q1 and q2.

◆ Dot() [6/15]

template<Internal::VectorNormalOrPointSimdType T, PlaneSimdType P>
T Harlinn::Math::Dot ( const T & v,
const P & plane )
inline

◆ Dot() [7/15]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Dot ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Dot() [8/15]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasSimdType<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::Dot ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Dot() [9/15]

template<TupleType T, TupleType U>
requires IsCompatible<T, U>
T::Simd Harlinn::Math::Dot ( const T & v1,
const U & v2 )
inlineconstexprnoexcept

◆ Dot() [10/15]

template<int mask, SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Dot ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Dot() [11/15]

template<int mask, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasSimdType<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::Dot ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Dot() [12/15]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::Dot ( const T & v1,
const U v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Dot() [13/15]

template<int mask, SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::Dot ( const T & v1,
const U v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Dot() [14/15]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::Dot ( const T v1,
const U & v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Dot() [15/15]

template<int mask, ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::Dot ( const T v1,
const U & v2 )
inlinenoexcept

Calculates the dot product between v1 and v2.

◆ Equal() [1/5]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::Equal ( const S & lhs,
const T & rhs,
const U & epsilon )
inlinenoexcept

Determines whether the elements of lhs and the corresponding elements of rhs are less or equally apart than the corresponding element of epsilon.

Parameters
lhsThe first source of values for the comparison.
rhsThe second source of values for the comparison.
epsilonThe source of the maximum difference between the corresponding elements from lhs and rhs.
Returns
If an element of lhs and the corresponding elements of rhs are less or equally apart than the corresponding element of epsilon, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Equal() [2/5]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::Equal ( const S & lhs,
const T & rhs,
U epsilon )
inlinenoexcept

Determines whether the elements of lhs and the corresponding elements of rhs are less or equally apart than the value of epsilon.

Parameters
lhsThe first source of values for the comparison.
rhsThe second source of values for the comparison.
epsilonThe maximum difference between the elements from lhs and rhs.
Returns
If an element of lhs and the corresponding elements of rhs are less or equally apart than the value of epsilon, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Equal() [3/5]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Equal ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether the elements of v1 are equal to the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
If an element of v1 is equal to the corresponding element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Equal() [4/5]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::Equal ( const T & v1,
U value )
inlinenoexcept

Determines whether the elements of v1 are equal to value.

Returns
If an element of v1 is equal to value, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Equal() [5/5]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::Equal ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is equal to the elements of v2.

Returns
If value is equal to an element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Erf()

template<FloatingPointType T>
T Harlinn::Math::Erf ( T x)
inlineconstexprnoexcept

Computes the error function of x.

◆ ErfC()

template<FloatingPointType T>
T Harlinn::Math::ErfC ( T x)
inlineconstexprnoexcept

Computes the complementary error function of x,.

◆ ErfInv()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::ErfInv ( FloatT a)
inlineconstexpr

◆ EvaluatePolynomial() [1/8]

template<SimdType T, typename C >
requires IsArithmetic<C>
T Harlinn::Math::EvaluatePolynomial ( const T & t,
C c )
inlineconstexpr

Evaluates the provided polynomial using Horner’s method.

◆ EvaluatePolynomial() [2/8]

template<SimdType T, SimdType C>
requires IsCompatible<T, C>
T Harlinn::Math::EvaluatePolynomial ( const T & t,
C c )
inlineconstexpr

◆ EvaluatePolynomial() [3/8]

template<SimdType T, typename C , typename... Args>
requires IsArithmetic<C>
T Harlinn::Math::EvaluatePolynomial ( const T & t,
C c,
Args... remaining )
inlineconstexpr

◆ EvaluatePolynomial() [4/8]

template<TupleType T, typename C , typename... Args>
requires IsArithmetic<C>
T::Simd Harlinn::Math::EvaluatePolynomial ( const T & t,
C c,
Args... remaining )
inlineconstexpr

◆ EvaluatePolynomial() [5/8]

template<SimdType T, SimdType C, typename... Args>
requires IsCompatible<T, C>
T Harlinn::Math::EvaluatePolynomial ( const T & t,
const C & c,
Args... remaining )
inlineconstexpr

◆ EvaluatePolynomial() [6/8]

template<TupleType T, SimdType C, typename... Args>
requires IsCompatible<T, C>
T::Simd Harlinn::Math::EvaluatePolynomial ( const T & t,
const C & c,
Args... remaining )
inlineconstexpr

◆ EvaluatePolynomial() [7/8]

template<ArithmeticType T, ArithmeticType C>
T Harlinn::Math::EvaluatePolynomial ( T t,
C c )
inlineconstexpr

◆ EvaluatePolynomial() [8/8]

template<ArithmeticType T, ArithmeticType C, ArithmeticType ... Args>
T Harlinn::Math::EvaluatePolynomial ( T t,
C c,
Args... remaining )
inlineconstexpr

◆ Exp() [1/2]

template<SimdType T>
auto Harlinn::Math::Exp ( const T & v)
inlinenoexcept

Calculates $$e$$ (Euler's number, 2.7182818...), raised to the power of each element in the argument.

◆ Exp() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Exp ( T x)
inlineconstexprnoexcept

Computes e, 2.7182818, raised to the given power x.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
e raised to the given power x.

◆ Exp10() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Exp10 ( const T & v)
inlinenoexcept

Calculates the base-10 exponential of each element in the argument.

◆ Exp10() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Exp10 ( T x)
inlineconstexprnoexcept

◆ Exp2() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Exp2 ( const T & v)
inlinenoexcept

Calculates the base-2 exponential of each element in the argument.

◆ Exp2() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Exp2 ( T x)
inlineconstexprnoexcept

◆ ExpM1() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::ExpM1 ( const T & v)
inlinenoexcept

Calculates $$e$$ (Euler's number, 2.7182818...), raised to the power of each element in the argument, $$-1.0$$.

◆ ExpM1() [2/2]

template<FloatingPointType T>
T Harlinn::Math::ExpM1 ( T x)
inlineconstexprnoexcept

◆ FastAbs() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::FastAbs ( const T & t)
inlinenoexcept

Computes the absolute value of each element held by the argument.

◆ FastAbs() [2/2]

template<UnsignedIntegerType T>
T Harlinn::Math::FastAbs ( T val)
inlineconstexprnoexcept

◆ FastATan()

template<SimdOrTupleType T>
auto Harlinn::Math::FastATan ( const T & v)
inlinenoexcept

Calculates the inverse tangent of each element in the argument, in radians.

◆ FastATan2()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FastATan2 ( const T & x,
const U & y )
inlinenoexcept

Calculates the inverse tangent of each element in x divided by the corresponding element in y, in radians.

◆ FastCos()

template<SimdOrTupleType T>
auto Harlinn::Math::FastCos ( const T & v)
inlinenoexcept

Calculates the cosine of each element in the argument expressed in radians.

◆ FastExp()

float Harlinn::Math::FastExp ( float x)
inlineconstexpr

◆ FastLog2()

template<FloatingPointType T>
T Harlinn::Math::FastLog2 ( T x)
inlineconstexpr

◆ FastNormalize() [1/2]

template<PlaneSimdType T>
T Harlinn::Math::FastNormalize ( const T & plane)
inlinenoexcept

◆ FastNormalize() [2/2]

template<PlaneType T>
T::Simd Harlinn::Math::FastNormalize ( const T & plane)
inlinenoexcept

◆ FastPow() [1/3]

template<int n, SimdType T>
T Harlinn::Math::FastPow ( const T & v)
inline

◆ FastPow() [2/3]

template<int n, TupleType T>
T::Simd Harlinn::Math::FastPow ( const T & v)
inline

◆ FastPow() [3/3]

template<int n, FloatingPointType T>
T Harlinn::Math::FastPow ( T v)
inlineconstexpr

◆ FastSin()

template<SimdOrTupleType T>
auto Harlinn::Math::FastSin ( const T & v)
inlinenoexcept

Calculates the sine of each element in the argument expressed in radians.

◆ FastSinCos() [1/2]

template<SimdType T>
T Harlinn::Math::FastSinCos ( const T & v,
T * cosines )
inlinenoexcept

Calculates the sine and cosine of each element in the argument expressed in radians.

◆ FastSinCos() [2/2]

template<TupleType T>
T::Simd Harlinn::Math::FastSinCos ( const T & v,
typename T::Simd * cosines )
inlinenoexcept

Calculates the sine and cosine of each element in the argument expressed in radians.

◆ FastTan()

template<SimdOrTupleType T>
auto Harlinn::Math::FastTan ( const T & v)
inlinenoexcept

Calculates the tangent of each element in the argument expressed in radians.

◆ FDim()

template<FloatingPointType T>
T Harlinn::Math::FDim ( T x,
T y )
inlineconstexprnoexcept

Returns the positive difference between x and y, that is, if x > y, returns x - y, otherwise (i.e. if x <= y) returns +0.

◆ FindInterval()

template<typename Predicate >
size_t Harlinn::Math::FindInterval ( size_t sz,
const Predicate & pred )
inlineconstexpr

◆ First()

template<SimdType T>
auto Harlinn::Math::First ( const T & v)
inline

Retrieves the lowest element of v.

◆ Floor() [1/5]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::Floor ( const Interval< FloatT > & i)
inline

◆ Floor() [2/5]

template<SimdOrTupleType T>
auto Harlinn::Math::Floor ( const T & t)
inlinenoexcept

Computes the floor of each element held by the argument.

◆ Floor() [3/5]

template<FloatingPointType T>
T Harlinn::Math::Floor ( T value)
inlineconstexprnoexcept

Just returns value.

Computes the largest integer value not greater than value.

Template Parameters
TA floating point type.
Parameters
valueA floating point value.
Returns
The largest integer value not greater than value.
Template Parameters
TAn integer type.
Parameters
valueAn integer value.
Returns
value

◆ Floor() [4/5]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
std::remove_cvref_t< T > Harlinn::Math::Floor ( T value)
inlineconstexprnoexcept

◆ Floor() [5/5]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
std::remove_cvref_t< T > Harlinn::Math::Floor ( T value)
inlineconstexprnoexcept

◆ floor()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::floor ( const Interval< FloatT > & i)
inline

◆ FMA() [1/10]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::FMA ( const Interval< FloatT > & a,
const Interval< FloatT > & b,
const Interval< FloatT > & c )
inline

◆ FMA() [2/10]

template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::FMA ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [3/10]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto Harlinn::Math::FMA ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [4/10]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::FMA ( const S & a,
const T & b,
const U c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [5/10]

template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto Harlinn::Math::FMA ( const S & a,
const T b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [6/10]

template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::FMA ( const S & a,
const T b,
const U c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [7/10]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FMA ( const S a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [8/10]

template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::FMA ( const S a,
const T & b,
const U c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [9/10]

template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::FMA ( const S a,
const T b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMA() [10/10]

template<IntegerType T>
T Harlinn::Math::FMA ( T a,
T b,
T c )
inlineconstexprnoexcept

Computes x * y + z.

Computes x * y + z as if to infinite precision and rounded only once to fit the result type.

◆ FMAAdjustDown() [1/11]

template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
T Harlinn::Math::FMAAdjustDown ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [2/11]

template<SimdType S, TupleType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
U Harlinn::Math::FMAAdjustDown ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [3/11]

template<SimdType S, TupleType T, TupleType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
S Harlinn::Math::FMAAdjustDown ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [4/11]

template<TupleType S, TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires IsCompatible<S, T>&& IsCompatible<T, U>
ResultT Harlinn::Math::FMAAdjustDown ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [5/11]

template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
T Harlinn::Math::FMAAdjustDown ( const T & a,
NumberT b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [6/11]

template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
U Harlinn::Math::FMAAdjustDown ( const T & a,
NumberT b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [7/11]

template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT Harlinn::Math::FMAAdjustDown ( const T & a,
NumberT b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [8/11]

template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
T Harlinn::Math::FMAAdjustDown ( NumberT a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [9/11]

template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
U Harlinn::Math::FMAAdjustDown ( NumberT a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [10/11]

template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT Harlinn::Math::FMAAdjustDown ( NumberT a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustDown() [11/11]

template<FloatingPointType T>
T Harlinn::Math::FMAAdjustDown ( T a,
T b,
T c )
inlineconstexpr

◆ FMAAdjustUp() [1/11]

template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
T Harlinn::Math::FMAAdjustUp ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [2/11]

template<SimdType S, TupleType T, SimdType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
U Harlinn::Math::FMAAdjustUp ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [3/11]

template<SimdType S, TupleType T, TupleType U>
requires IsCompatible<S, T>&& IsCompatible<T, U>
S Harlinn::Math::FMAAdjustUp ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [4/11]

template<TupleType S, TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires IsCompatible<S, T>&& IsCompatible<T, U>
ResultT Harlinn::Math::FMAAdjustUp ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [5/11]

template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
T Harlinn::Math::FMAAdjustUp ( const T & a,
NumberT b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [6/11]

template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
U Harlinn::Math::FMAAdjustUp ( const T & a,
NumberT b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [7/11]

template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT Harlinn::Math::FMAAdjustUp ( const T & a,
NumberT b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [8/11]

template<typename NumberT , SimdType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
T Harlinn::Math::FMAAdjustUp ( NumberT a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [9/11]

template<typename NumberT , TupleType T, SimdType U>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
U Harlinn::Math::FMAAdjustUp ( NumberT a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [10/11]

template<typename NumberT , TupleType T, TupleType U, typename ResultT = typename T::Simd>
requires std::is_arithmetic_v<NumberT>&& IsCompatible<T, U>
ResultT Harlinn::Math::FMAAdjustUp ( NumberT a,
const T & b,
const U & c )
inlinenoexcept

Multiplies the corresponding elements of a and b, adding the result to the corresponding element of c.

◆ FMAAdjustUp() [11/11]

template<FloatingPointType T>
T Harlinn::Math::FMAAdjustUp ( T a,
T b,
T c )
inlineconstexpr

◆ FMAddSub() [1/7]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::FMAddSub ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.

◆ FMAddSub() [2/7]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::FMAddSub ( const S & a,
const T & b,
const U c )
inlinenoexcept

Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.

◆ FMAddSub() [3/7]

template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto Harlinn::Math::FMAddSub ( const S & a,
const T b,
const U & c )
inlinenoexcept

Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.

◆ FMAddSub() [4/7]

template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::FMAddSub ( const S & a,
const T b,
const U c )
inlinenoexcept

Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.

◆ FMAddSub() [5/7]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FMAddSub ( const S a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.

◆ FMAddSub() [6/7]

template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::FMAddSub ( const S a,
const T & b,
const U c )
inlinenoexcept

Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.

◆ FMAddSub() [7/7]

template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::FMAddSub ( const S a,
const T b,
const U & c )
inlinenoexcept

Performs a set of multiply-add-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are added to the intermediate results while the even values are subtracted from them. The final results are rounded to the nearest floating point values.

◆ FMod() [1/4]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FMod ( const T & x,
const U & y )
inlinenoexcept

Computes the floating-point remainder of the division operation $x/y$.

◆ FMod() [2/4]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::FMod ( const T & x,
const U y )
inlinenoexcept

Computes the floating-point remainder of the division operation $x/y$.

◆ FMod() [3/4]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::FMod ( const T x,
const U & y )
inlinenoexcept

Computes the floating-point remainder of the division operation $x/y$.

◆ FMod() [4/4]

template<FloatingPointType T>
T Harlinn::Math::FMod ( T x,
T y )
inlineconstexprnoexcept

Computes the point remainder of the division operation x / y.

Template Parameters
FloatTA floating point type.
Parameters
xA floating point value.
yA floating point value.
Returns
The floating point remainder of the division operation x / y.

◆ FMSub() [1/7]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::FMSub ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.

◆ FMSub() [2/7]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::FMSub ( const S & a,
const T & b,
const U c )
inlinenoexcept

Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.

◆ FMSub() [3/7]

template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto Harlinn::Math::FMSub ( const S & a,
const T b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.

◆ FMSub() [4/7]

template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::FMSub ( const S & a,
const T b,
const U c )
inlinenoexcept

Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.

◆ FMSub() [5/7]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FMSub ( const S a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.

◆ FMSub() [6/7]

template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::FMSub ( const S a,
const T & b,
const U c )
inlinenoexcept

Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.

◆ FMSub() [7/7]

template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::FMSub ( const S a,
const T b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the infinite precision intermediate results are obtained. From the infinite precision intermediate results, the values in the third operand, c, are subtracted. The final results are rounded to the nearest floating point values.

◆ FMSubAdd() [1/7]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::FMSubAdd ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.

◆ FMSubAdd() [2/7]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::FMSubAdd ( const S & a,
const T & b,
const U c )
inlinenoexcept

Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.

◆ FMSubAdd() [3/7]

template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto Harlinn::Math::FMSubAdd ( const S & a,
const T b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.

◆ FMSubAdd() [4/7]

template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::FMSubAdd ( const S & a,
const T b,
const U c )
inlinenoexcept

Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.

◆ FMSubAdd() [5/7]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FMSubAdd ( const S a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.

◆ FMSubAdd() [6/7]

template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::FMSubAdd ( const S a,
const T & b,
const U c )
inlinenoexcept

Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.

◆ FMSubAdd() [7/7]

template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::FMSubAdd ( const S a,
const T b,
const U & c )
inlinenoexcept

Performs a set of multiply-subtract-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and infinite precision intermediate results are obtained. The odd values in the third operand, c, are subtracted from the intermediate results while the even values are added to them. The final results are rounded to the nearest floating point values.

◆ FNMAdd() [1/7]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::FNMAdd ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.

◆ FNMAdd() [2/7]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::FNMAdd ( const S & a,
const T & b,
const U c )
inlinenoexcept

Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.

◆ FNMAdd() [3/7]

template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto Harlinn::Math::FNMAdd ( const S & a,
const T b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.

◆ FNMAdd() [4/7]

template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::FNMAdd ( const S & a,
const T b,
const U c )
inlinenoexcept

Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.

◆ FNMAdd() [5/7]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FNMAdd ( const S a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.

◆ FNMAdd() [6/7]

template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::FNMAdd ( const S a,
const T & b,
const U c )
inlinenoexcept

Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.

◆ FNMAdd() [7/7]

template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::FNMAdd ( const S a,
const T b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-add computation on a, b, and c. Corresponding values in two operands, a and b, are multiplied and the negated infinite precision intermediate results are added to the values in the third operand, c, after which the final results are rounded to the nearest floating point values.

◆ FNMSub() [1/7]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::FNMSub ( const S & a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.

◆ FNMSub() [2/7]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::FNMSub ( const S & a,
const T & b,
const U c )
inlinenoexcept

Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.

◆ FNMSub() [3/7]

template<SimdOrTupleType S, ArithmeticType T, SimdOrTupleType U>
requires IsCompatible<S, U>
auto Harlinn::Math::FNMSub ( const S & a,
const T b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.

◆ FNMSub() [4/7]

template<SimdOrTupleType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::FNMSub ( const S & a,
const T b,
const U c )
inlinenoexcept

Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.

◆ FNMSub() [5/7]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::FNMSub ( const S a,
const T & b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.

◆ FNMSub() [6/7]

template<ArithmeticType S, SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::FNMSub ( const S a,
const T & b,
const U c )
inlinenoexcept

Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.

◆ FNMSub() [7/7]

template<ArithmeticType S, ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::FNMSub ( const S a,
const T b,
const U & c )
inlinenoexcept

Performs a set of negated multiply-subtract computation on a, b, and c. The values in two operands, a and b, are multiplied and the negated infinite precision intermediate result is obtained. From this negated intermediate result, the value in the third operand, c, is subtracted. The final result is rounded to the nearest floating point value.

◆ FRExp() [1/3]

template<FloatingPointType T>
std::pair< T, int > Harlinn::Math::FRExp ( T val)
inlineconstexprnoexcept

Decomposes the given floating point value val into a normalized fraction and an integral power of two.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
Returns
A std::pair<>> with the normalized fraction stored in first and the exponent stored in second.

If val is zero, both first and second are set to zero.

If val is not zero, and no errors occur, the function returns a value, x, in the range( -1; -0.5], [ 0.5; 1 ) in first and stores an integer value in second such that result.first*2^( result.second ) = val.

If the value to be stored in result.second is outside the range of int, the behavior is unspecified.

◆ FRExp() [2/3]

template<FloatingPointType T>
T Harlinn::Math::FRExp ( T val,
int & exp )
inlineconstexprnoexcept

Decomposes the given floating point value val into a normalized fraction and an integral power of two.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
expA reference to an integer value to store the exponent to.
Returns
If val is zero, returns zero and stores zero in exp.

If val is not zero, and no errors occur, the function returns a value, x, in the range( -1; -0.5], [ 0.5; 1 ) and stores an integer value in exp such that x*2^( exp ) = val.

If the value to be stored in exp is outside the range of int, the behavior is unspecified.

◆ FRExp() [3/3]

template<FloatingPointType T>
T Harlinn::Math::FRExp ( T val,
int * exp )
inlineconstexprnoexcept

Decomposes the given floating point value val into a normalized fraction and an integral power of two.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
expA pointer to an integer value to store the exponent to.
Returns
If val is zero, returns zero and stores zero in *exp.

If val is not zero, and no errors occur, the function returns a value, x, in the range( -1; -0.5], [ 0.5; 1 ) and stores an integer value in *exp such that x*2^( *exp ) = val.

If the value to be stored in *exp is outside the range of int, the behavior is unspecified.

◆ Gamma()

template<FloatingPointType T>
T Harlinn::Math::Gamma ( int n)
inlineconstexpr

◆ Gaussian()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::Gaussian ( FloatT x,
FloatT mu = 0,
FloatT sigma = 1 )
inlineconstexpr

◆ GaussianIntegral()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::GaussianIntegral ( FloatT x0,
FloatT x1,
FloatT mu = 0,
FloatT sigma = 1 )
inlineconstexpr

◆ Greater() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Greater ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether the elements of v1 are greater than the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
If an element of v1 is greater than the corresponding element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Greater() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::Greater ( const T & v1,
U value )
inlinenoexcept

Determines whether the elements of v1 are greater than value.

Returns
If an element of v1 is greater than value, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Greater() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::Greater ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is greater than the elements of v2.

Returns
If value is greater than an element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ GreaterOrEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::GreaterOrEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether the elements of v1 are greater than, or equal to, the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
If an element of v1 is greater than, or equal to, the corresponding element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ GreaterOrEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::GreaterOrEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether the elements of v1 are greater than, or equal to, value.

Returns
If an element of v1 is greater than, or equal to, value, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ GreaterOrEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::GreaterOrEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is greater than, or equal to, the elements of v2.

Returns
If value is greater than, or equal to, an element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Hermite()

template<SimdOrTupleType T, SimdOrTupleType U, SimdOrTupleType V, SimdOrTupleType W, ArithmeticType X>
requires IsCompatible<T, U, V, W>
auto Harlinn::Math::Hermite ( const T & firstPosition,
const U & firstTangent,
const V & secondPosition,
const W & secondTangent,
const X t )
inlinenoexcept

Calculates the Hermite spline interpolation, using the specified arguments.

◆ HProd() [1/2]

template<SimdType T>
T Harlinn::Math::HProd ( const T & t)
inlinenoexcept

Calculates the horizontal product of the elements in the vector.

◆ HProd() [2/2]

template<TupleType T>
T::Simd Harlinn::Math::HProd ( const T & t)
inlinenoexcept

Calculates the horizontal product of the elements in the vector.

◆ HSum() [1/2]

template<SimdType T>
T Harlinn::Math::HSum ( const T & t)
inlinenoexcept

Calculates the horizontal sum of the elements in the vector.

◆ HSum() [2/2]

template<TupleType T>
T::Simd Harlinn::Math::HSum ( const T & t)
inlinenoexcept

Calculates the horizontal sum of the elements in the vector.

◆ Hypot() [1/5]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Hypot ( const T & x,
const U & y )
inlinenoexcept

Calculates the square root of the sum of the squares of each corresponding element in x and y, without undue overflow or underflow at intermediate stages of the computation.

◆ Hypot() [2/5]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::Hypot ( const T & x,
const U y )
inlinenoexcept

Calculates the square root of the sum of the squares of each corresponding element in x and y, without undue overflow or underflow at intermediate stages of the computation.

◆ Hypot() [3/5]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::Hypot ( const T x,
const U & y )
inlinenoexcept

Calculates the square root of the sum of the squares of each corresponding element in x and y, without undue overflow or underflow at intermediate stages of the computation.

◆ Hypot() [4/5]

template<FloatingPointType T>
T Harlinn::Math::Hypot ( T x,
T y )
inlineconstexprnoexcept

Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
yA floating point value.
Returns
The square root of the sum of the squares of x and y.

◆ Hypot() [5/5]

template<FloatingPointType T>
T Harlinn::Math::Hypot ( T x,
T y,
T z )
inlineconstexprnoexcept

◆ I0()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::I0 ( FloatT x)
inlineconstexpr

◆ ILogB()

template<FloatingPointType T>
int Harlinn::Math::ILogB ( T x)
inlineconstexprnoexcept

Extracts the value of the unbiased exponent from the floating-point argument x, and returns it as a signed integer value.

◆ InBounds()

template<SimdOrTupleType S, SimdOrTupleType T>
requires IsCompatible<S, T>
auto Harlinn::Math::InBounds ( const S & v,
const T & bounds )
inlinenoexcept

Detects if the elements of a vector are within bounds.

Parameters
vThe elements to test against the bounds.
boundsThe bounds
Returns
An element in the result will have all bits set if the corresponding element of v are greater or equal to the corresponding negated value from bounds, and less or equal to the corresponding value from bounds, otherwise the element will be set to 0.

◆ InnerProduct()

template<typename FloatT , typename... T>
requires std::conjunction_v<std::is_arithmetic<T>...>
FloatT Harlinn::Math::InnerProduct ( FloatT term,
T... terms )
inlineconstexpr

◆ InRange() [1/2]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
bool Harlinn::Math::InRange ( const Interval< FloatT > & first,
const Interval< FloatT > & second )
inlineconstexpr

◆ InRange() [2/2]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
bool Harlinn::Math::InRange ( FloatT value,
const Interval< FloatT > & interval )
inlineconstexpr

◆ Intersect() [1/2]

template<PlaneType P, PointSimdType PT>
PT Harlinn::Math::Intersect ( const P & plane,
const PT & linePoint1,
const PT & linePoint2 )
inlinenoexcept

◆ Intersect() [2/2]

std::pair< Point3f::Simd, Point3f::Simd > Harlinn::Math::Intersect ( const Plane< float >::Simd & plane1,
const Plane< float >::Simd & plane2 )
inlinenoexcept

◆ Inverse() [1/7]

SquareMatrix< float, 2 >::Simd Harlinn::Math::Inverse ( const SquareMatrix< float, 2 > & matrix)
inline

◆ Inverse() [2/7]

SquareMatrix< float, 3 >::Simd Harlinn::Math::Inverse ( const SquareMatrix< float, 3 > & matrix,
typename Vector< float, 3 >::Simd * determinant = nullptr )
inline

◆ Inverse() [3/7]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Inverse ( const SquareMatrix< float, 4 > & matrix,
typename Vector< float, 4 >::Simd * determinant = nullptr )
inline

Calculates the inverse of the matrix.

Parameters
matrixThe matrix to invert.
determinantAddress of a Vector<float, 4>::Simd object where each element will be assigned the determinant of the matrix.
Returns
Returns the matrix inverse of matrix. If the provided matrix is singular with a determinant equal to 0, Inverse returns an infinite matrix.

◆ Inverse() [4/7]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Inverse ( const SquareMatrix< float, 4 >::Simd & matrix,
typename Vector< float, 4 >::Simd * determinant = nullptr )
inline

Calculates the inverse of the matrix.

Parameters
matrixThe matrix to invert.
determinantAddress of a Vector<float, 4>::Simd object where each element will be assigned the determinant of the matrix.
Returns
Returns the matrix inverse of matrix. If the provided matrix is singular with a determinant equal to 0, Inverse returns an infinite matrix.

◆ Inverse() [5/7]

template<QuaternionOrQuaternionSimdType T>
auto Harlinn::Math::Inverse ( const T & q)
noexcept

Calculates the inverse of a quaternion.

Parameters
qThe quaternion.
Returns
The inverse quaternion.

◆ Inverse() [6/7]

SquareMatrix< float, 2 >::Simd Harlinn::Math::Inverse ( const typename SquareMatrix< float, 2 >::Simd & matrix,
typename SquareMatrix< float, 2 >::Simd * determinant = nullptr )
inline

◆ Inverse() [7/7]

SquareMatrix< float, 3 >::Simd Harlinn::Math::Inverse ( const typename SquareMatrix< float, 3 >::Simd & matrix,
typename Vector< float, 3 >::Simd * determinant = nullptr )
inline

◆ InverseRotate()

template<SimdOrTupleType S, QuaternionOrQuaternionSimdType T>
requires ( S::Size == 3 )
S Harlinn::Math::InverseRotate ( const S & v,
const T & rotationQuaternion )

Rotates a vector using the inverse of a quaternion.

Parameters
vThe vector to rotate.
rotationQuaternionQuaternion describing the rotation to apply to the vector.
Returns
The rotated vector.

◆ InvertBilinear()

Point2f Harlinn::Math::InvertBilinear ( const Point2f & p,
const std::array< Point2f, 4 > & vert )
inline

◆ IsFinite() [1/2]

template<IntegerType T>
bool Harlinn::Math::IsFinite ( T val)
inlineconstexprnoexcept

All integers have finite values.

Determines if the given floating point number val has finite value i.e. it is normal, subnormal or zero, but not infinite or NaN.

◆ IsFinite() [2/2]

template<ArithmeticType T, ArithmeticType ... Args>
bool Harlinn::Math::IsFinite ( T val,
Args ... args )
inlineconstexprnoexcept

Determines if all the arguments are finite.

◆ IsInf() [1/3]

template<SimdOrTupleType T>
auto Harlinn::Math::IsInf ( const T & t)
inlinenoexcept

Determines which of the elements of t are Inf.

Parameters
tThe source of the values for the test.
Returns
If an element of t is Inf, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ IsInf() [2/3]

template<IntegerType T>
bool Harlinn::Math::IsInf ( T val)
inlineconstexprnoexcept

Integers cannot represent infinite, so this function always returns false.

Template Parameters
TAny integer type.
Parameters
valAn integer value.
Returns
false

Determines if the given floating point number val is positive or negative infinity.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
Returns
true if val has an infinite value, otherwise false.

◆ IsInf() [3/3]

template<ArithmeticType T, ArithmeticType ... Args>
bool Harlinn::Math::IsInf ( T val,
Args ... args )
inlineconstexprnoexcept

Determines if any of the given integral or floating point numbers is positive or negative infinity.

Template Parameters
TIntegral or floating point type.
...ArgsIntegral or floating point types.
Parameters
valIntegral or floating point value.
...argsIntegral or floating point value.
Returns
true if any of the given integral or floating point numbers is positive or negative infinity, otherwise false.

◆ IsNaN() [1/3]

template<SimdOrTupleType T>
auto Harlinn::Math::IsNaN ( const T & t)
inlinenoexcept

Determines which of the elements of t are NaN.

Parameters
tThe source of the values for the test.
Returns
If an element of t is NaN, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ IsNaN() [2/3]

template<IntegerType T>
bool Harlinn::Math::IsNaN ( T val)
inlineconstexprnoexcept

IsNaN for integer types, always returns false.

Template Parameters
TAny integer type
Parameters
valInteger value.
Returns
false

Determines if the given floating point number, val, is a not-a-number (NaN) value.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
Returns
true if val is a not-a-number (NaN) value.

◆ IsNaN() [3/3]

template<ArithmeticType T, ArithmeticType ... Args>
bool Harlinn::Math::IsNaN ( T val,
Args ... args )
inlineconstexprnoexcept

Determines if any of the given integral or floating point values are a not-a-number (NaN) value.

Template Parameters
TIntegral or floating point type.
...ArgsIntegral or floating point types.
Parameters
valIntegral or floating point value.
...argsIntegral or floating point value.
Returns
true if any of the given integral or floating point values is a not-a-number (NaN) value, otherwise false.

◆ IsNormal() [1/2]

template<IntegerType T>
bool Harlinn::Math::IsNormal ( T val)
inlineconstexprnoexcept

All integers, except 0, are <q>normal</q>.

Determines if the given floating point number val is normal, i.e. is neither zero, subnormal, infinite, nor NaN.

◆ IsNormal() [2/2]

template<ArithmeticType T, ArithmeticType ... Args>
bool Harlinn::Math::IsNormal ( T val,
Args ... args )
inlineconstexprnoexcept

Determines if all the arguments are normal.

◆ IsPowerOf4()

template<typename T >
bool Harlinn::Math::IsPowerOf4 ( T v)
inlineconstexpr

◆ IsSameValue()

template<FloatingPointType T>
bool Harlinn::Math::IsSameValue ( T first,
T second )
inlineconstexprnoexcept

Tests whether two floating point values holds the same value. This function returns true if both hold the same NaN value.

Tests two integral values for equality.

Parameters
firstA floating point value.
secondA floating point value.
Returns
true if both arguments are binary equivalent, otherwise false.

◆ IsZero()

template<FloatingPointType T>
bool Harlinn::Math::IsZero ( T x)
inlineconstexprnoexcept

Tests if a floating point value is zero.

Tests if an integral value is zero.

Parameters
xA floating point value.
Returns
true if the argument is zero, otherwise false.

◆ J0()

template<FloatingPointType T>
T Harlinn::Math::J0 ( T x)
inlineconstexprnoexcept

Calculates the Bessel function of the first kind of order 0 for x.

◆ J1()

template<FloatingPointType T>
T Harlinn::Math::J1 ( T x)
inlineconstexprnoexcept

Calculates the Bessel function of the first kind of order 1 for x.

◆ JN()

template<FloatingPointType T>
T Harlinn::Math::JN ( int n,
T x )
inlineconstexprnoexcept

Calculates the Bessel function of the first kind of order n for x.

◆ Length() [1/2]

template<FloatingPointType T, size_t N>
Vector< T, N > Harlinn::Math::Length ( const SegmentSimd< T, N > & segment)
noexcept

◆ Length() [2/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Length ( const T & q)
inlinenoexcept

Calculates the length of v.

Calculates the magnitude of a quaternion.

Parameters
qThe quaternion.
Returns
The magnitude of the quaternion.

◆ LengthSquared()

template<SimdType T>
auto Harlinn::Math::LengthSquared ( const T & q)
inlinenoexcept

Calculates the squared length of v.

Calculates the square of the magnitude of a quaternion.

Parameters
qThe quaternion.
Returns
The square of the magnitude of the quaternion.

◆ Lerp() [1/9]

template<ArithmeticType NumberT1, ArithmeticType NumberT2, SimdOrTupleType T>
auto Harlinn::Math::Lerp ( const NumberT1 a,
const NumberT2 b,
const T & t )
inlinenoexcept

Calculates the linear interpolation between a and b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp() [2/9]

template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::Lerp ( const S & a,
const T & b,
const U & t )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp() [3/9]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto Harlinn::Math::Lerp ( const S & a,
const T & b,
const U & t )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp() [4/9]

template<SimdType T, SimdType U, ArithmeticType NumberT>
requires IsCompatible<T, U>
auto Harlinn::Math::Lerp ( const T & a,
const U & b,
NumberT t )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp() [5/9]

template<SimdOrTupleType T, SimdOrTupleType U, ArithmeticType NumberT>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::Lerp ( const T & a,
const U & b,
NumberT t )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp() [6/9]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT>
std::remove_cvref_t< T > Harlinn::Math::Lerp ( T a,
T b,
T t )
inlineconstexprnoexcept

◆ Lerp() [7/9]

template<typename T >
requires Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::SizeT>
std::remove_cvref_t< T > Harlinn::Math::Lerp ( T a,
T b,
T t )
inlineconstexprnoexcept

◆ Lerp() [8/9]

template<ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::Lerp ( T a,
T b,
U t )
inlineconstexprnoexcept

Computes the linear interpolation between a and b, if the parameter t is inside [​0​, 1), the linear extrapolation otherwise, i.e. the result of a + t * ( b - a ) with accounting for floating point calculation imprecision.

Template Parameters
T
U
Parameters
aAn arithmetic type.
bAn arithmetic type.
tAn arithmetic type.
Returns
The interpolated or extrapolated result.

◆ Lerp() [9/9]

template<typename T , typename U >
requires (Harlinn::Windows::Internal::IsSpecializationOf<std::remove_cvref_t<T>, Harlinn::Windows::PointT> && IsFloatingPoint<U> )
std::remove_cvref_t< T > Harlinn::Math::Lerp ( T a,
T b,
U t )
inlineconstexprnoexcept

◆ Lerp2() [1/6]

template<SimdType S, SimdType T, SimdType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::Lerp2 ( const S & t,
const T & a,
const U & b )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp2() [2/6]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>&& Internal::HasTupleType<S, T, U>
auto Harlinn::Math::Lerp2 ( const S & t,
const T & a,
const U & b )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp2() [3/6]

template<SimdType S, ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::Lerp2 ( const S & t,
const T a,
const U b )
inlinenoexcept

Calculates the linear interpolation between a and b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp2() [4/6]

template<ArithmeticType S, SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Lerp2 ( const S t,
const T & a,
const U & b )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp2() [5/6]

template<ArithmeticType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::Lerp2 ( const S t,
const T & a,
const U & b )
inlinenoexcept

Calculates the linear interpolation between the the elements of a and the elements of b, for elements of t is inside [0,1), or the linear extrapolation for elements in t outside [0,1).

◆ Lerp2() [6/6]

template<ArithmeticType T, ArithmeticType U>
auto Harlinn::Math::Lerp2 ( U t,
T a,
T b )
inlineconstexprnoexcept

◆ Less() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Less ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether the elements of v1 are less than the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
If an element of v1 is less than the corresponding element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Less() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::Less ( const T & v1,
U value )
inlinenoexcept

Determines whether the elements of v1 are less than value.

Returns
If an element of v1 is less than value, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ Less() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::Less ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is less than the elements of v2.

Returns
If value is less than an element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ LessOrEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::LessOrEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether the elements of v1 are less than, or equal to, the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
If an element of v1 is less than, or equal to, the corresponding element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ LessOrEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::LessOrEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether the elements of v1 are less than, or equal to, value.

Returns
If an element of v1 is less than, or equal to, value, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ LessOrEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::LessOrEqual ( const T value,
const U & v2 )
inlinenoexcept

Determines whether value is less than, or equal to, the elements of v2.

Returns
If value is less than, or equal to, an element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ LGamma()

template<FloatingPointType T>
T Harlinn::Math::LGamma ( T x)
inlineconstexprnoexcept

Computes the natural logarithm of the absolute value of the gamma function of x.

◆ LinePointDistance()

template<PointOrPointSimdType S, PointOrPointSimdType T, PointOrPointSimdType U>
requires IsCompatible<S, T>&& IsCompatible<S, U>
auto Harlinn::Math::LinePointDistance ( const S & linePoint1,
const T & linePoint2,
const U & point )
inlinenoexcept

Calculates the minimum distance between a line and a point.

Parameters
linePoint1First point on the line.
linePoint2Second point on the line.
pointThe reference point.
Returns
The minimum distance between a line and a point.

◆ Log() [1/2]

template<SimdType T>
auto Harlinn::Math::Log ( const T & q)
inlinenoexcept

Calculates the natural logarithm of each element in the argument.

Calculates the natural logarithm of a unit quaternion.

Parameters
qThe unit quaternion.
Returns
The natural logarithm of q1.

◆ Log() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Log ( T x)
inlineconstexprnoexcept

Computes the natural, base e, logarithm of x.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The natural, base e, logarithm of x.

◆ Log10() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Log10 ( const T & v)
inlinenoexcept

Calculates the base-10 logarithm of each element in the argument.

◆ Log10() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Log10 ( T x)
inlineconstexprnoexcept

Computes the common, base 10, logarithm of x.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The common, base 10, logarithm of x.

◆ Log1P() [1/2]

template<SimdType T>
auto Harlinn::Math::Log1P ( const T & v)
inlinenoexcept

Calculates the natural logarithm of 1 + each element in the argument.

◆ Log1P() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Log1P ( T x)
inlineconstexprnoexcept

◆ Log2() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Log2 ( const T & v)
inlinenoexcept

Calculates the base-2 logarithm, $$log_{2}_$$, of each element in the argument.

◆ Log2() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Log2 ( T x)
inlineconstexprnoexcept

Computes the binary, base-2, logarithm of x.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The binary, base-2, logarithm of x.

◆ Log2Int() [1/6]

int Harlinn::Math::Log2Int ( double v)
inlineconstexpr

◆ Log2Int() [2/6]

int Harlinn::Math::Log2Int ( float v)
inlineconstexpr

◆ Log2Int() [3/6]

int Harlinn::Math::Log2Int ( Int32 v)
inlineconstexpr

◆ Log2Int() [4/6]

int Harlinn::Math::Log2Int ( Int64 v)
inlineconstexpr

◆ Log2Int() [5/6]

int Harlinn::Math::Log2Int ( UInt32 v)
inlineconstexpr

◆ Log2Int() [6/6]

int Harlinn::Math::Log2Int ( UInt64 v)
inlineconstexpr

◆ Log4Int()

template<typename T >
requires std::is_arithmetic_v<T>
int Harlinn::Math::Log4Int ( T v)
inlineconstexpr

◆ LogB()

template<FloatingPointType T>
T Harlinn::Math::LogB ( T x)
inlineconstexprnoexcept

Extracts the value of the unbiased radix-independent exponent from the floating-point argument x, and returns it as a floating-point value.

◆ LogI0()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::LogI0 ( FloatT x)
inlineconstexpr

◆ Logistic()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::Logistic ( FloatT x,
FloatT s )
inlineconstexpr

◆ LogisticCDF()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::LogisticCDF ( FloatT x,
FloatT s )
inlineconstexpr

◆ LookAt()

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U> && ( S::Size == 3 )
SquareMatrix< typenameS::value_type, 4 >::Simd Harlinn::Math::LookAt ( const S & cameraPosition,
const T & focusPosition,
const U & upDirection )
inlinenoexcept

Creates a view matrix using the left-handed coordinate system for the provided camera position, focal point, and up direction.

Parameters
cameraPositionThe camera position.
focusPositionThe focal point.
upDirectionThe up direction of the camera, often [0 1 0]
Returns
The view matrix transforming coordinates from world space to view space.

◆ LookTo()

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U> && ( S::Size == 3 )
SquareMatrix< typenameS::value_type, 4 >::Simd Harlinn::Math::LookTo ( const S & cameraPosition,
const T & cameraDirection,
const U & upDirection )
inlinenoexcept

Creates a view matrix using the left-handed coordinate system for the provided camera position, camera direction, and up direction.

Parameters
cameraPositionThe camera position.
cameraDirectionThe camera direction.
upDirectionThe up direction of the camera, often [0 1 0]
Returns
The view matrix transforming coordinates from world space to view space.

◆ Max() [1/8]

Harlinn::Windows::Graphics::PointF Harlinn::Math::Max ( const Harlinn::Windows::Graphics::PointF & first,
const Harlinn::Windows::Graphics::PointF & second )
constexpr

◆ Max() [2/8]

Harlinn::Windows::Graphics::SizeF Harlinn::Math::Max ( const Harlinn::Windows::Graphics::SizeF & first,
const Harlinn::Windows::Graphics::SizeF & second )
constexpr

◆ Max() [3/8]

Harlinn::Windows::Point Harlinn::Math::Max ( const Harlinn::Windows::Point & first,
const Harlinn::Windows::Point & second )
constexpr

◆ Max() [4/8]

Harlinn::Windows::Size Harlinn::Math::Max ( const Harlinn::Windows::Size & first,
const Harlinn::Windows::Size & second )
constexpr

◆ Max() [5/8]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::Max ( const Interval< FloatT > & a,
const Interval< FloatT > & b )
inline

◆ Max() [6/8]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Max ( const T & lhs,
const U & rhs )
inlinenoexcept

Makes a comparison between the elements held by the two arguments, and returns a TupleSimd containing the largest elements.

◆ Max() [7/8]

template<FloatingPointType T>
T Harlinn::Math::Max ( T first,
T second )
inlineconstexprnoexcept

Returns the larger of the given values.

Template Parameters
TA floating point type.
Parameters
firstThe first floating point value.
secondThe second floating point value.
Returns
Returns the larger of first and second.
Template Parameters
TAn integer type.
Parameters
firstThe first integer value.
secondThe second integer value.
Returns
Returns the larger of first and second.

◆ Max() [8/8]

template<FloatingPointType T, FloatingPointType ... Args>
T Harlinn::Math::Max ( T first,
T second,
Args... remaining )
inlineconstexprnoexcept

◆ max()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::max ( const Interval< FloatT > & a,
const Interval< FloatT > & b )
inline

◆ MaxComponentIndex()

template<TupleType T>
size_t Harlinn::Math::MaxComponentIndex ( const T & v)
inlineconstexprnoexcept

Retrieves the offset of the highest value held by the argument.

Parameters
vThe argument.
Returns
The offset of the highest value held by the argument.

◆ MaxComponentValue() [1/2]

template<SimdType T>
auto Harlinn::Math::MaxComponentValue ( const T & v)
inlinenoexcept

Retrieves the highest value held by the argument.

Parameters
vThe argument.
Returns
The highest value held by the argument.

◆ MaxComponentValue() [2/2]

template<TupleType T>
auto Harlinn::Math::MaxComponentValue ( const T & v)
inlineconstexprnoexcept

Retrieves the highest value held by the argument.

Parameters
vThe argument.
Returns
The highest value held by the argument.

◆ Min() [1/8]

Harlinn::Windows::Graphics::PointF Harlinn::Math::Min ( const Harlinn::Windows::Graphics::PointF & first,
const Harlinn::Windows::Graphics::PointF & second )
constexpr

◆ Min() [2/8]

Harlinn::Windows::Graphics::SizeF Harlinn::Math::Min ( const Harlinn::Windows::Graphics::SizeF & first,
const Harlinn::Windows::Graphics::SizeF & second )
constexpr

◆ Min() [3/8]

Harlinn::Windows::Point Harlinn::Math::Min ( const Harlinn::Windows::Point & first,
const Harlinn::Windows::Point & second )
constexpr

◆ Min() [4/8]

Harlinn::Windows::Size Harlinn::Math::Min ( const Harlinn::Windows::Size & first,
const Harlinn::Windows::Size & second )
constexpr

◆ Min() [5/8]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::Min ( const Interval< FloatT > & a,
const Interval< FloatT > & b )
inline

◆ Min() [6/8]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Min ( const T & lhs,
const U & rhs )
inlinenoexcept

Makes a comparison between the elements held by the two arguments, and returns a TupleSimd derived object containing the smallest elements.

◆ Min() [7/8]

template<FloatingPointType T>
T Harlinn::Math::Min ( T first,
T second )
inlineconstexprnoexcept

Returns the smaller of the given values.

Template Parameters
TA floating point type.
Parameters
firstThe first floating point value.
secondThe second floating point value.
Returns
Returns the smaller of first and second.
Template Parameters
TAn integer type.
Parameters
firstThe first integer value.
secondThe second integer value.
Returns
Returns the smaller of first and second.

◆ Min() [8/8]

template<FloatingPointType T, FloatingPointType ... Args>
T Harlinn::Math::Min ( T first,
T second,
Args... remaining )
inlineconstexprnoexcept

◆ min()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::min ( const Interval< FloatT > & a,
const Interval< FloatT > & b )
inline

◆ MinComponentIndex() [1/2]

template<TupleType T>
size_t Harlinn::Math::MinComponentIndex ( const T & v)
inlineconstexprnoexcept

Retrieves the offset of the lowest value held by the argument.

Parameters
vThe argument.
Returns
The offset of the lowest value held by the argument.

◆ MinComponentIndex() [2/2]

template<SimdType T, typename ResultT = typename T::value_type>
size_t Harlinn::Math::MinComponentIndex ( const T & v)
inlineconstexprnoexcept

Retrieves the offset of the lowest value held by the argument.

Parameters
vThe argument.
Returns
The offset of the lowest value held by the argument.

◆ MinComponentValue() [1/2]

template<SimdType T>
auto Harlinn::Math::MinComponentValue ( const T & v)
inlinenoexcept

Retrieves the lowest value held by the argument.

Parameters
vThe argument.
Returns
The lowest value held by the argument.

◆ MinComponentValue() [2/2]

template<TupleType T>
auto Harlinn::Math::MinComponentValue ( const T & v)
inlineconstexprnoexcept

Retrieves the lowest value held by the argument.

Parameters
vThe argument.
Returns
The lowest value held by the argument.

◆ Mod()

template<FloatingPointType T>
T Harlinn::Math::Mod ( T a,
T b )
inlineconstexpr

◆ ModAngles()

template<SimdOrTupleType T>
auto Harlinn::Math::ModAngles ( const T & angles)
inline

Calculates the angle modulo 2PI.

Template Parameters
TA TupleN SimdType
Parameters
anglesThe angles in radians
Returns
Returns a SimdType holding the angles modulo 2PI.

◆ ModF() [1/3]

template<FloatingPointType T>
std::pair< T, T > Harlinn::Math::ModF ( T val)
inlineconstexprnoexcept

Decomposes floating-point value val into its integral and fractional parts, each with the same type and sign as val.

This implementation can also be constexpr evaluated.

Template Parameters
ValueTA floating point type.
Parameters
valA floating point value.
Returns
A std::pair<T,T> where first holds the integral part of the result and second holds the fractional part.

◆ ModF() [2/3]

template<FloatingPointType T>
T Harlinn::Math::ModF ( T val,
T & integerPart )
inlineconstexprnoexcept

Decomposes floating-point value val into its integral and fractional parts, each with the same type and sign as val.

This implementation can also be constexpr evaluated.

Template Parameters
ValueTA floating point type.
Parameters
valA floating point value.
integerPartA reference to a variable of the ValueT floating point type that receives the integral part of val.
Returns
The fractional part of val.

◆ ModF() [3/3]

template<FloatingPointType T>
T Harlinn::Math::ModF ( T val,
T * integerPart )
inlineconstexprnoexcept

Decomposes floating-point value val into its integral and fractional parts, each with the same type and sign as val.

This implementation can also be constexpr evaluated.

Template Parameters
ValueTA floating point type.
Parameters
valA floating point value.
integerPartA pointer to a variable of the ValueT floating point type that receives the integral part of val.
Returns
The fractional part of val.

◆ MulAdjustDown() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::MulAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ MulAdjustDown() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::MulAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ MulAdjustDown() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::MulAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ MulAdjustDown() [4/4]

template<FloatingPointType T>
T Harlinn::Math::MulAdjustDown ( T a,
T b )
inlineconstexpr

◆ MulAdjustUp() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::MulAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ MulAdjustUp() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::MulAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ MulAdjustUp() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::MulAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ MulAdjustUp() [4/4]

template<FloatingPointType T>
T Harlinn::Math::MulAdjustUp ( T a,
T b )
inlineconstexpr

◆ MulPow2() [1/2]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::MulPow2 ( const Interval< FloatT > & i,
FloatT s )
inline

◆ MulPow2() [2/2]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::MulPow2 ( FloatT s,
const Interval< FloatT > & i )
inline

◆ Multiply() [1/4]

template<SimpleSpanLike T>
requires IsArithmetic<typename T::value_type>
T::value_type Harlinn::Math::Multiply ( const T & values)
inlineconstexpr

◆ Multiply() [2/4]

SquareMatrix< float, 2 >::Simd Harlinn::Math::Multiply ( const typename SquareMatrix< float, 2 >::Simd & matrix1,
const typename SquareMatrix< float, 2 >::Simd & matrix2 )
inline

◆ Multiply() [3/4]

SquareMatrix< float, 3 >::Simd Harlinn::Math::Multiply ( const typename SquareMatrix< float, 3 >::Simd & matrix1,
const typename SquareMatrix< float, 3 >::Simd & matrix2 )
inline

◆ Multiply() [4/4]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Multiply ( const typename SquareMatrix< float, 4 >::Simd & matrix1,
const typename SquareMatrix< float, 4 >::Simd & matrix2 )
inline

◆ NewtonBisection()

template<typename Func , typename FloatT >
FloatT Harlinn::Math::NewtonBisection ( FloatT x0,
FloatT x1,
Func f,
FloatT xEps = static_cast< FloatT >( 1e-6 ),
FloatT fEps = static_cast< FloatT >( 1e-6 ) )
inlineconstexpr

◆ NextAfter() [1/2]

double Harlinn::Math::NextAfter ( double x,
double y )
inlineconstexprnoexcept

Returns the next representable value of x in the direction of y. If x equals to y, y is returned.

Parameters
xA double precision floating point value.
yA double precision floating point value.
Returns
The next representable value of x in the direction of y. is returned. If x equals y, then y is returned

◆ NextAfter() [2/2]

float Harlinn::Math::NextAfter ( float x,
float y )
inlineconstexprnoexcept

Returns the next representable value of x in the direction of y. If x equals to y, y is returned.

Parameters
xA single precision floating point value.
yA single precision floating point value.
Returns
The next representable value of x in the direction of y. is returned. If x equals y, then y is returned

◆ NextDown() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::NextDown ( const T & t)
inlinenoexcept

◆ NextDown() [2/2]

template<FloatingPointType T>
T Harlinn::Math::NextDown ( T x)
inlineconstexprnoexcept

Return the largest floating point number y of the same type as x such that y < x. If no such y exists, e.g. if x is -Inf or NaN, then return x.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
Returns
The largest floating point number y of the same type as x such that y < x.

◆ NextFloatDown()

template<FloatingPointType T>
T Harlinn::Math::NextFloatDown ( T v)
constexpr

◆ NextFloatUp()

template<FloatingPointType T>
T Harlinn::Math::NextFloatUp ( T v)
inlineconstexpr

◆ NextUp() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::NextUp ( const T & t)
inlinenoexcept

◆ NextUp() [2/2]

template<FloatingPointType T>
T Harlinn::Math::NextUp ( T x)
inlineconstexprnoexcept

Return the smallest floating point number y of the same type as x such that x < y. If no such y exists, e.g. if x is Inf or NaN, then return x.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
Returns
The smallest floating point number y of the same type as x such that x < y.

◆ Normalize() [1/3]

template<PlaneSimdType T>
T Harlinn::Math::Normalize ( const T & plane)
inlinenoexcept

◆ Normalize() [2/3]

template<PlaneType T>
T::Simd Harlinn::Math::Normalize ( const T & plane)
inlinenoexcept

◆ Normalize() [3/3]

template<SimdOrTupleType T>
auto Harlinn::Math::Normalize ( const T & q)
inlinenoexcept

Normalizes v.

Normalizes a quaternion.

Parameters
qThe quaternion.
Returns
The normalized quaternion.

◆ NotEqual() [1/3]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::NotEqual ( const T & v1,
const U & v2 )
inlinenoexcept

Determines whether the elements of v1 are not equal to the corresponding elements of v2.

Parameters
v1The first source of values for the comparison.
v2The second source of values for the comparison.
Returns
If an element of v1 is not equal to the corresponding element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ NotEqual() [2/3]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::NotEqual ( const T & v1,
const U value )
inlinenoexcept

Determines whether the elements of v1 are not equal to value.

Returns
If an element of v1 is not equal to value, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ NotEqual() [3/3]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::NotEqual ( T value,
const U & v2 )
inlinenoexcept

Determines whether value is not equal to the elements of v2.

Returns
If value is not equal to an element of v2, the corresponding element in the result will be set to 0xFFFFFFFF, otherwise the corresponding element in the result will be set to 0.

◆ operator*() [1/11]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator* ( const Interval< FloatT > & i,
FloatT f )
inline

◆ operator*() [2/11]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::operator* ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator*() [3/11]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::operator* ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator*() [4/11]

template<SimdType T, ArithmeticType U>
auto Harlinn::Math::operator* ( const T & lhs,
const U rhs )
inlinenoexcept

◆ operator*() [5/11]

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto Harlinn::Math::operator* ( const T & q1,
const U & q2 )
noexcept

◆ operator*() [6/11]

template<ArithmeticType T, SimdType U>
auto Harlinn::Math::operator* ( const T lhs,
const U & rhs )
inlinenoexcept

◆ operator*() [7/11]

template<SquareMatrixSimdType T1, ArithmeticType T2>
auto Harlinn::Math::operator* ( const T1 & m,
const T2 value )
inlinenoexcept

◆ operator*() [8/11]

template<SquareMatrixSimdType T1, SquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>
T2 Harlinn::Math::operator* ( const T1 & m1,
const T2 & m2 )
inlinenoexcept

◆ operator*() [9/11]

template<SquareMatrixOrSquareMatrixSimdType T1, SquareMatrixOrSquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>&& Internal::HasSquareMatrixType<T1, T2>
T2 Harlinn::Math::operator* ( const T1 & m1,
const T2 & m2 )
inlinenoexcept

◆ operator*() [10/11]

template<ArithmeticType T1, SquareMatrixSimdType T2>
auto Harlinn::Math::operator* ( const T1 value,
const T2 & m )
inlinenoexcept

◆ operator*() [11/11]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator* ( FloatT f,
const Interval< FloatT > & i )
inline

◆ operator+() [1/9]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator+ ( const Interval< FloatT > & i,
FloatT f )
inline

◆ operator+() [2/9]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::operator+ ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator+() [3/9]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::operator+ ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator+() [4/9]

template<SimdType T, ArithmeticType U>
auto Harlinn::Math::operator+ ( const T & lhs,
const U rhs )
inlinenoexcept

◆ operator+() [5/9]

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto Harlinn::Math::operator+ ( const T & q1,
const U & q2 )
noexcept

◆ operator+() [6/9]

template<ArithmeticType T, SimdType U>
auto Harlinn::Math::operator+ ( const T lhs,
const U & rhs )
inlinenoexcept

◆ operator+() [7/9]

template<SquareMatrixSimdType T1, SquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>
auto Harlinn::Math::operator+ ( const T1 & m1,
const T2 & m2 )
inlinenoexcept

◆ operator+() [8/9]

template<SquareMatrixOrSquareMatrixSimdType T1, SquareMatrixOrSquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>&& Internal::HasSquareMatrixType<T1, T2>
auto Harlinn::Math::operator+ ( const T1 & m1,
const T2 & m2 )
inlinenoexcept

◆ operator+() [9/9]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator+ ( FloatT f,
const Interval< FloatT > & i )
inline

◆ operator-() [1/9]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator- ( const Interval< FloatT > & i,
FloatT f )
inline

◆ operator-() [2/9]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::operator- ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator-() [3/9]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::operator- ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator-() [4/9]

template<SimdType T, ArithmeticType U>
auto Harlinn::Math::operator- ( const T & lhs,
const U rhs )
inlinenoexcept

◆ operator-() [5/9]

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto Harlinn::Math::operator- ( const T & q1,
const U & q2 )
noexcept

◆ operator-() [6/9]

template<ArithmeticType T, SimdType U>
auto Harlinn::Math::operator- ( const T lhs,
const U & rhs )
inlinenoexcept

◆ operator-() [7/9]

template<SquareMatrixSimdType T1, SquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>
auto Harlinn::Math::operator- ( const T1 & m1,
const T2 & m2 )
inlinenoexcept

◆ operator-() [8/9]

template<SquareMatrixOrSquareMatrixSimdType T1, SquareMatrixOrSquareMatrixSimdType T2>
requires IsCompatibleMatrix<T1, T2>&& Internal::HasSquareMatrixType<T1, T2>
auto Harlinn::Math::operator- ( const T1 & m1,
const T2 & m2 )
inlinenoexcept

◆ operator-() [9/9]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator- ( FloatT f,
const Interval< FloatT > & i )
inline

◆ operator/() [1/7]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator/ ( const Interval< FloatT > & i,
FloatT f )
inline

◆ operator/() [2/7]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::operator/ ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator/() [3/7]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasTupleType<T, U>
auto Harlinn::Math::operator/ ( const T & lhs,
const U & rhs )
inlinenoexcept

◆ operator/() [4/7]

template<SimdType T, ArithmeticType U>
auto Harlinn::Math::operator/ ( const T & lhs,
const U rhs )
inlinenoexcept

◆ operator/() [5/7]

template<ArithmeticType T, SimdType U>
auto Harlinn::Math::operator/ ( const T lhs,
const U & rhs )
inlinenoexcept

◆ operator/() [6/7]

template<SquareMatrixSimdType T1, ArithmeticType T2>
auto Harlinn::Math::operator/ ( const T1 & m,
const T2 value )
inlinenoexcept

◆ operator/() [7/7]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::operator/ ( FloatT f,
const Interval< FloatT > & i )
inline

◆ operator<<()

template<typename CharT , size_t N>
auto Harlinn::Math::operator<< ( std::basic_ostream< CharT > & os,
const SquareMatrix< float, N > & value )
inline

◆ Orthogonal()

template<SimdOrTupleType S>
auto Harlinn::Math::Orthogonal ( const S & v)
inlinenoexcept

Computes a vector perpendicular to the argument vector.

Parameters
vThe argument vector.
Returns
The vector orthogonal to v.

◆ Permute()

template<int shuffleMask, SimdOrTupleType T>
T Harlinn::Math::Permute ( const T & t)
inlinenoexcept

◆ PerspectiveFovProjection()

template<typename T >
requires IsFloatingPoint<T>
SquareMatrix< T, 4 >::Simd Harlinn::Math::PerspectiveFovProjection ( T fovAngleY,
T aspectRatio,
T nearZ,
T farZ )
inlinenoexcept

Creates a left-handed perspective projection matrix based on a field of view.

Parameters
fovAngleYThe top-down field-of-view angle in radians.
aspectRatioThe aspect ratio of the view-space X/Y.
nearZThe distance to the nearest clipping plane. Cannot be equal to farZ and must be greater than zero.
farZThe distance to the far clipping plane. Cannot be equal to nearZ and must be greater than zero.
Returns
The perspective projection matrix.

◆ PerspectiveProjection()

template<typename T >
requires IsFloatingPoint<T>
SquareMatrix< T, 4 >::Simd Harlinn::Math::PerspectiveProjection ( T viewWidth,
T viewHeight,
T nearZ,
T farZ )
inlinenoexcept

Creates a left-handed perspective projection matrix.

Parameters
viewWidthThe width of the frustum at the nearest clipping plane.
viewHeightThe height of the frustum at the nearest clipping plane.
nearZThe distance to the nearest clipping plane. Cannot be equal to farZ and must be greater than zero.
farZThe distance to the far clipping plane. Cannot be equal to nearZ and must be greater than zero.
Returns
The perspective projection matrix.

◆ Pow() [1/4]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::Pow ( const T & base,
const U & exponent )
inlinenoexcept

Calculates the elements in base raised to the corresponding element in exponent.

◆ Pow() [2/4]

template<ArithmeticType T, SimdOrTupleType U>
auto Harlinn::Math::Pow ( const T & base,
const U & exponent )
inlinenoexcept

Returns the value of base raised to the corresponding elements in exponent.

◆ Pow() [3/4]

template<SimdOrTupleType T, ArithmeticType U>
auto Harlinn::Math::Pow ( const T & base,
const U exponent )
inlinenoexcept

Calculates the elements in base raised to the value of exponent.

◆ Pow() [4/4]

template<FloatingPointType T>
T Harlinn::Math::Pow ( T x,
T y )
inlineconstexprnoexcept

Computes the value of x raised to the power y.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
yA floating point value.
Returns
x raised to the power y.

◆ Project()

template<SimdType S, typename FloatT = S::value_type, typename MatrixT = typename SquareMatrix<FloatT, 4>::Simd>
S Harlinn::Math::Project ( const S & v,
FloatT viewportX,
FloatT viewportY,
FloatT viewportWidth,
FloatT viewportHeight,
FloatT viewportMinZ,
FloatT viewportMaxZ,
const MatrixT & projection,
const MatrixT & viewTransform,
const MatrixT & WorldTransform )
noexcept

Projects a 3D coordinate from object space into screen space.

Parameters
vThe 3D coordinate.
viewportXThe x-coordinate of the upper-left corner of the viewport. Assign 0 to this parameter, unless you only need to render to a subset of the surface,
viewportYThe y-coordinate of the upper-left corner of the viewport. Assign 0 to this parameter, unless you only need to render to a subset of the surface.
viewportWidthThe width of the clip volume, Assign the width of the render target surface to this parameter, unless you only need to render to a subset of the surface.
viewportHeightThe height of the clip volume, Assign the height of the render target surface to this parameter, unless you only need to render to a subset of the surface.
viewportMinZThe minimum depth of the clip volume, usually 0.0f.
viewportMaxZThe maximum depth of the clip volume, usually 1.0f.
projectionThe projection matrix.
viewTransformThe view transform matrix.
WorldTransformThe world transform matrix.
Returns
Returns the coordinate projected into screen space.

◆ Quadratic() [1/2]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
bool Harlinn::Math::Quadratic ( const Interval< FloatT > & a,
const Interval< FloatT > & b,
const Interval< FloatT > & c,
Interval< FloatT > * t0,
Interval< FloatT > * t1 )
inline

◆ Quadratic() [2/2]

template<typename FloatT , typename... T>
requires IsFloatingPoint<FloatT>
bool Harlinn::Math::Quadratic ( FloatT a,
FloatT b,
FloatT c,
FloatT * t0,
FloatT * t1 )
inlineconstexpr

◆ Rad2Deg()

template<FloatingPointType T>
T Harlinn::Math::Rad2Deg ( T angleInRadians)
inlineconstexprnoexcept

Converts an angle in radians into the corresponding angle in degrees.

Template Parameters
TA floating point type.
Parameters
angleInRadiansThe angle in radians.
Returns
The angle in degrees.

◆ Radians()

template<FloatingPointType T>
T Harlinn::Math::Radians ( T deg)
inlineconstexpr

◆ Reciprocal()

template<SimdOrTupleType T>
auto Harlinn::Math::Reciprocal ( const T & t)
inlinenoexcept

Calculates the reciprocal of each element in the argument.

◆ ReciprocalLength()

template<SimdOrTupleType T>
auto Harlinn::Math::ReciprocalLength ( const T & q1)
inlinenoexcept

Calculates the reciprocal length of v.

Calculates the reciprocal of the magnitude of a quaternion.

Parameters
q1The quaternion.
Returns
The reciprocal of the magnitude of the quaternion.

◆ ReciprocalSqrt() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::ReciprocalSqrt ( const T & v)
inlinenoexcept

Calculates the reciprocal square root of each element in the argument.

◆ ReciprocalSqrt() [2/2]

template<FloatingPointType T>
T Harlinn::Math::ReciprocalSqrt ( T x)
inlineconstexprnoexcept

◆ Reflect()

template<SimdOrTupleType S, SimdOrTupleType T>
requires IsCompatible<S, T>
auto Harlinn::Math::Reflect ( const S & incident,
const T & normal )
inlinenoexcept

Reflects an incident vector across a normal vector.

Parameters
incidentIncident vector to reflect.
normalNormal vector to reflect the incident vector across.
Returns
The reflected incident angle.

◆ Refract() [1/2]

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
auto Harlinn::Math::Refract ( const S & incident,
const T & normal,
const U & refractionIndex )
inlinenoexcept

Refracts an incident vector across a normal vector.

Parameters
incidentThe incident vector to refract.
normalThe normal vector to refract the incident vector through.
refractionIndexA vector whose elements are equal to the index of refraction.
Returns
Returns the refracted incident vector. If the refraction index and the angle between the incident vector and the normal are such that the result is a total internal reflection, the function will return a vector with all elements set to zero.

◆ Refract() [2/2]

template<SimdOrTupleType S, SimdOrTupleType T, ArithmeticType U>
requires IsCompatible<S, T>
auto Harlinn::Math::Refract ( const S & incident,
const T & normal,
const U refractionIndex )
inlinenoexcept

Refracts an incident vector across a normal vector.

Parameters
incidentThe incident vector to refract.
normalThe normal vector to refract the incident vector through.
refractionIndexThe index of refraction.
Returns
Returns the refracted incident vector. If the refraction index and the angle between the incident vector and the normal are such that the result is a total internal reflection, the function will return a vector with all elements set to zero.

◆ Remainder()

template<FloatingPointType T>
T Harlinn::Math::Remainder ( T x,
T y )
inlineconstexprnoexcept

Computes the IEEE remainder of the floating point division operation x / y.

◆ RemQuo()

template<FloatingPointType T>
T Harlinn::Math::RemQuo ( T x,
T y,
int * quo )
inlineconstexprnoexcept

Computes the floating-point remainder of the division operation x / y like Remainder. Additionally, the sign and at least the three of the last bits of x / y will be stored in quo, sufficient to determine the octant of the result within a period.

◆ Rotate()

template<SimdOrTupleType S, QuaternionOrQuaternionSimdType T>
requires ( S::Size == 3 )
auto Harlinn::Math::Rotate ( const S & v,
const T & rotationQuaternion )

Rotates a vector using a quaternion.

Parameters
vThe vector to rotate.
rotationQuaternionQuaternion describing the rotation to apply to the vector.
Returns
The rotated vector.

◆ Rotation() [1/4]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Rotation ( const Quaternion< float > & q)
inlinenoexcept

Creates a rotation matrix from a quaternion.

Parameters
qThe quaternion that defines the rotation.
Returns
The rotation matrix.

◆ Rotation() [2/4]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Rotation ( const Quaternion< float >::Simd & q)
inlinenoexcept

Creates a rotation matrix from a quaternion.

Parameters
qThe quaternion that defines the rotation.
Returns
The rotation matrix.

◆ Rotation() [3/4]

template<SimdType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd Harlinn::Math::Rotation ( const S & v)
inlinenoexcept

Creates a transformation matrix that rotates about the y-axis, then the x-axis, and finally the z-axis.

Parameters
vThe angles of rotation around the x-axis, y-axis and z-axis, in radians.
Returns
The transformation matrix.

◆ Rotation() [4/4]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Rotation ( float xAxisRotation,
float yAxisRotation,
float zAxisRotation )
inlinenoexcept

Creates a transformation matrix that rotates about the y-axis, then the x-axis, and finally the z-axis.

Parameters
xAxisRotationThe angle of rotation around the x-axis, in radians.
yAxisRotationThe angle of rotation around the y-axis, in radians.
zAxisRotationThe angle of rotation around the z-axis, in radians.
Returns
The transformation matrix.

◆ RotationAxis()

template<SimdOrTupleType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd Harlinn::Math::RotationAxis ( const S & axis,
float angle )
inlinenoexcept

Creates a matrix that rotates around an arbitrary axis.

Parameters
axisThe axis of rotation.
angleThe angle of rotation in radians, measured clockwise when looking along the rotation axis toward the origin.
Returns
The rotation matrix.

◆ RotationNormal()

template<SimdType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd Harlinn::Math::RotationNormal ( const S & normalizedAxis,
float angle )
inlinenoexcept

Creates a matrix that rotates around a normalized vector.

Parameters
normalizedAxisNormalized vector defining the axis of rotation.
angleThe angle of rotation in radians, measured clockwise when looking along the rotation axis toward the origin.
Returns
The rotation matrix
Parameters
normalizedAxisNormalized vector defining the axis of rotation.
angleThe angle of rotation in radians, measured clockwise when looking along the rotation axis toward the origin.
Returns
The rotation matrix.

◆ RotationQuaternion() [1/2]

SquareMatrix< float, 4 >::Simd Harlinn::Math::RotationQuaternion ( const Quaternion< float > & q)
inlinenoexcept

Creates a rotation matrix from a quaternion.

Parameters
qThe quaternion that defines the rotation.
Returns
The rotation matrix.

◆ RotationQuaternion() [2/2]

SquareMatrix< float, 4 >::Simd Harlinn::Math::RotationQuaternion ( const Quaternion< float >::Simd & q)
inlinenoexcept

Creates a rotation matrix from a quaternion.

Parameters
qThe quaternion that defines the rotation.
Returns
The rotation matrix.

◆ RotationX()

SquareMatrix< float, 4 >::Simd Harlinn::Math::RotationX ( float angle)
inlinenoexcept

Creates a matrix that rotates around the x-axis.

Parameters
angleThw clockwise angle of rotation, in radians, around the x-axis when looking along the rotation axis toward the origin.
Returns
The rotation matrix.

◆ RotationY()

SquareMatrix< float, 4 >::Simd Harlinn::Math::RotationY ( float angle)
inlinenoexcept

Creates a matrix that rotates around the y-axis.

Parameters
angleThw clockwise angle of rotation, in radians, around the y-axis when looking along the rotation axis toward the origin.
Returns
The rotation matrix.

◆ RotationZ()

SquareMatrix< float, 4 >::Simd Harlinn::Math::RotationZ ( float angle)
inlinenoexcept

Creates a matrix that rotates around the z-axis.

Parameters
angleThw clockwise angle of rotation, in radians, around the z-axis when looking along the rotation axis toward the origin.
Returns
The rotation matrix.

◆ Round() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Round ( const T & t)
inlinenoexcept

Rounds each element held by the argument towards the nearest even integer.

◆ Round() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Round ( T value)
inlineconstexprnoexcept

Just returns value.

Computes the nearest integer to value, in floating-point format, rounding halfway cases away from zero.

Template Parameters
TA floating point type.
Parameters
valueA floating point value.
Returns
The nearest integer to value.
Template Parameters
TAn integer type.
Parameters
valueAn integer value.
Returns
value

◆ RoundUpPow2() [1/2]

Int32 Harlinn::Math::RoundUpPow2 ( Int32 v)
inlineconstexpr

◆ RoundUpPow2() [2/2]

Int64 Harlinn::Math::RoundUpPow2 ( Int64 v)
inlineconstexpr

◆ RoundUpPow4()

template<typename T >
T Harlinn::Math::RoundUpPow4 ( T v)
inlineconstexpr

◆ SafeACos()

template<FloatingPointType T>
T Harlinn::Math::SafeACos ( T x)
inlineconstexpr

◆ SafeASin()

template<FloatingPointType T>
T Harlinn::Math::SafeASin ( T x)
inlineconstexpr

◆ SafeSqrt() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::SafeSqrt ( const T & v)
inlinenoexcept

Calculates the square root of each element greater or equal to 0.f in the argument. For elements less than 0.f, the result is 0.f.

◆ SafeSqrt() [2/2]

template<FloatingPointType T>
T Harlinn::Math::SafeSqrt ( T x)
inlineconstexpr

◆ Saturate()

template<SimdOrTupleType T>
auto Harlinn::Math::Saturate ( const T & v)
inlinenoexcept

Saturates the elements of v to the range 0.0 to 1.0.

◆ ScalarAbsDot()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::ScalarAbsDot ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the absolute value of the dot product between v1 and v2.

◆ ScalarAngleBetween() [1/2]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
auto Harlinn::Math::ScalarAngleBetween ( const T & v1,
const U & v2 )
inlineconstexpr

◆ ScalarAngleBetween() [2/2]

template<typename DerivedT , typename FloatT >
FloatT Harlinn::Math::ScalarAngleBetween ( const Tuple3< DerivedT, FloatT > & v1,
const Tuple3< DerivedT, FloatT > & v2 )
inlineconstexpr

◆ ScalarAvg()

template<SimdOrTupleType T>
T::value_type Harlinn::Math::ScalarAvg ( const T & t)
inlinenoexcept

Calculates the average value of the elements in the argument.

◆ ScalarDeterminant() [1/4]

float Harlinn::Math::ScalarDeterminant ( const SquareMatrix< float, 3 > & matrix)
inline

◆ ScalarDeterminant() [2/4]

float Harlinn::Math::ScalarDeterminant ( const SquareMatrix< float, 3 >::Simd & matrix)
inline

◆ ScalarDeterminant() [3/4]

float Harlinn::Math::ScalarDeterminant ( const SquareMatrix< float, 4 > & matrix)
inline

Calculates the determinant of a matrix.

Parameters
matrixThe matrix that the determinant will be calculated for.
Returns
The determinant of the matrix.

◆ ScalarDeterminant() [4/4]

float Harlinn::Math::ScalarDeterminant ( const SquareMatrix< float, 4 >::Simd & matrix)
inline

Calculates the determinant of a matrix.

Parameters
matrixThe matrix that the determinant will be calculated for.
Returns
The determinant of the matrix.

◆ ScalarDistance()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::ScalarDistance ( const T & p1,
const U & p2 )
inlinenoexcept

◆ ScalarDistanceSquared() [1/2]

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>&& Internal::HasSimdType<T, U>
auto Harlinn::Math::ScalarDistanceSquared ( const T & p1,
const U & p2 )
inlinenoexcept

Calculates the squared distance between p1 and p2.

◆ ScalarDistanceSquared() [2/2]

template<TupleType T, TupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::ScalarDistanceSquared ( const T & p1,
const U & p2 )
inlineconstexprnoexcept

Calculates the squared distance between p1 and p2.

◆ ScalarDot() [1/2]

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U>
requires IsCompatibleQuaternion<T, U>
auto Harlinn::Math::ScalarDot ( const T & q1,
const U & q2 )
noexcept

Calculates the dot product of two quaternions.

Parameters
q1The first quaternion.
q2The second quaternion.
Returns
The dot product between q1 and q2.

◆ ScalarDot() [2/2]

template<SimdType T, SimdType U>
requires IsCompatible<T, U>
T::value_type Harlinn::Math::ScalarDot ( const T & v1,
const U & v2 )
inlineconstexprnoexcept

◆ ScalarHProd() [1/2]

template<SimdType T>
auto Harlinn::Math::ScalarHProd ( const T & t)
inlinenoexcept

◆ ScalarHProd() [2/2]

template<TupleType T, typename ResultT = typename T::value_type>
ResultT Harlinn::Math::ScalarHProd ( const T & t)
inlinenoexcept

Calculates the horizontal product of the elements in the vector.

◆ ScalarHSum()

template<SimdType T>
T::value_type Harlinn::Math::ScalarHSum ( const T & t)
inlinenoexcept

Calculates the horizontal sum of the elements in the vector.

◆ ScalarLength()

template<SimdOrTupleType T>
auto Harlinn::Math::ScalarLength ( const T & q)
inlinenoexcept

Calculates the length of v.

Calculates the magnitude of a quaternion.

Parameters
qThe quaternion.
Returns
The magnitude of the quaternion.

◆ ScalarLengthSquared()

template<SimdType T>
auto Harlinn::Math::ScalarLengthSquared ( const T & q)
inlinenoexcept

Calculates the square of the magnitude of a quaternion.

Parameters
qThe quaternion.
Returns
The square of the magnitude of the quaternion.

◆ ScalarReciprocalLength()

template<SimdOrTupleType T>
auto Harlinn::Math::ScalarReciprocalLength ( const T & q1)
inlinenoexcept

Calculates the reciprocal length of v.

Calculates the reciprocal of the magnitude of a quaternion.

Parameters
q1The quaternion.
Returns
The reciprocal of the magnitude of the quaternion.

◆ ScaleBN() [1/2]

double Harlinn::Math::ScaleBN ( double x,
int n )
inlineconstexprnoexcept

Multiplies a double precision floating point value x multplied by FLT_RADIX raised to power n.

FLT_RADIX is the radix used by the representation of the floating point types.

Parameters
xA double precision floating point value.
nAn integer.
Returns
x multiplied by FLT_RADIX raised to power n

◆ ScaleBN() [2/2]

float Harlinn::Math::ScaleBN ( float x,
int n )
inlineconstexprnoexcept

Multiplies a double precision floating point value x multplied by FLT_RADIX raised to power n.

FLT_RADIX is the radix used by the representation of the floating point types.

Parameters
xA double precision floating point value.
nAn integer.
Returns
x multplied by FLT_RADIX raised to power n

◆ Scaling() [1/4]

template<SimdType S>
requires ( S::Size > 2 )
SquareMatrix< float, 4 >::Simd Harlinn::Math::Scaling ( const S & v)
inlinenoexcept

Creates a transformation matrix for scaling along the x-axis, y-axis, and z-axis.

Parameters
vScaling factors along the x-axis, y-axis, and z-axis.
Returns
The scaling matrix.

◆ Scaling() [2/4]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Scaling ( float scale)
inline

Creates a transformation matrix for scaling along the x-axis, y-axis, and z-axis.

Parameters
vScaling factor along the x-axis, y-axis, and z-axis.
Returns
The scaling matrix.

◆ Scaling() [3/4]

SquareMatrix< float, 3 >::Simd Harlinn::Math::Scaling ( float scaleX,
float scaleY )
inline

◆ Scaling() [4/4]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Scaling ( float scaleX,
float scaleY,
float scaleZ )
inline

Creates a transformation matrix for scaling along the x-axis, y-axis, and z-axis.

Parameters
scaleXScaling factor along the x-axis.
scaleYScaling factor along the y-axis.
scaleZScaling factor along the z-axis.
Returns
The scaling matrix.

◆ Select()

template<SimdOrTupleType S, SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<S, T, U>
S Harlinn::Math::Select ( const S & v1,
const T & v2,
const U & control )
inlinenoexcept

Performs a per-component selection between two input vectors and returns the resulting vector.

Parameters
v1The first source to select elements from.
v2The second source to select elements from.
controlMask used to select an element from either v1 or v2. If an element in control is zero, the corresponding element in the result will be from v1, if an element control is 0xFFFFFFFF, the corresponding element in the result will be from v2.

◆ ShortestArc()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U> && ( T::Size == 3 )
auto Harlinn::Math::ShortestArc ( const T & fromDir,
const U & toDir )
inlinenoexcept

Creates the shortest-arc rotation between two directions.

Parameters
fromDirThe from direction.

///

Parameters
toDirThe to direction.
Returns
The rotation quaternion.

◆ SignBit()

template<SignedIntegerType T>
bool Harlinn::Math::SignBit ( T val)
inlineconstexprnoexcept

Determines if the given signed integer value is negative.

An Implementation of SignBit for unsigned integers that always returns false.

Template Parameters
TAny signed integer type.
Parameters
valA signed integer value.
Returns
returns true if the value is signed, otherwise false.
Template Parameters
TAny unsigned integer type.
Parameters
valAn unsigned integer value.
Returns
false

Determines if the given floating point number is negative.

Currently this implementation is 70 % faster than std::signbit, and it can also be constexpr evaluated.

Template Parameters
TA floating point type.
Parameters
valA floating point value.
Returns
true if val is less than 0.0.

◆ signum()

template<UnsignedIntegerOrBooleanType T>
T Harlinn::Math::signum ( T val)
inlineconstexprnoexcept

Returns the sign of a value for a signed integer type.

Returns the sign of a value for a floating point type.

Returns the sign of a value for a bool or an unsigned integer type.

This function treats bool as an unsigned integer.

Template Parameters
Tbool or an unsigned integer type.
Parameters
valThe value to test.
Returns
If invoked with a bool this function returns true if the value is not false, otherwise false.

If invoked with an unsigned integer type this function returns 1 if the value is greater than 0, otherwise 0.

Template Parameters
TAny signed integer type.
Parameters
valThe value to test.
Returns
Returns:
  • -1 if val is less than zero.
  • 0 if val is equal to zero.
  • 1 if val is greater than zero.
Template Parameters
TA floating point type.
Parameters
valThe value to test.
Returns
Returns:
  • -1.0 if val is less than zero.
  • 0.0 if val is equal to zero.
  • 1.0 if val is greater than zero.

◆ Sin() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::Sin ( const Interval< FloatT > & i)
inline

◆ Sin() [2/3]

template<SimdOrTupleType T>
auto Harlinn::Math::Sin ( const T & v)
inlinenoexcept

Calculates the sine of each element in the argument expressed in radians.

◆ Sin() [3/3]

template<FloatingPointType T>
T Harlinn::Math::Sin ( T x)
inlineconstexprnoexcept

Computes the sine of x given in radians.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The sine of x given in radians.

◆ Sinc()

template<FloatingPointType T>
T Harlinn::Math::Sinc ( T x)
inlineconstexpr

◆ SinCos() [1/5]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
void Harlinn::Math::SinCos ( const Interval< FloatT > & i,
Interval< FloatT > * sine,
Interval< FloatT > * cosine )
inline

◆ SinCos() [2/5]

template<SimdType T>
T Harlinn::Math::SinCos ( const T & v,
T * cosines )
inlinenoexcept

Calculates the sine and cosine of each element in the argument expressed in radians.

◆ SinCos() [3/5]

template<TupleType T>
T::Simd Harlinn::Math::SinCos ( const T & v,
typename T::Simd * cosines )
inlinenoexcept

Calculates the sine and cosine of each element in the argument expressed in radians.

◆ SinCos() [4/5]

template<FloatingPointType T>
void Harlinn::Math::SinCos ( T x,
T & sinResult,
T & cosResult )
inlineconstexprnoexcept

Simultaneously compute the sine and cosine of x, where x is in radians, returning the sine in the variable referenced by sinResult, and the cosine in the variable referenced by cosResult.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
sinResult
cosResult

◆ SinCos() [5/5]

template<FloatingPointType T>
void Harlinn::Math::SinCos ( T x,
T * sinResult,
T * cosResult )
inlineconstexprnoexcept

Simultaneously compute the sine and cosine of x, where x is in radians, returning the sine in the variable referenced by sinResult, and the cosine in the variable referenced by cosResult.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
sinResult
cosResult

◆ SinH() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::SinH ( const T & v)
inlinenoexcept

Calculates the hyperbolic sine of each element in the argument expressed in radians.

◆ SinH() [2/2]

template<FloatingPointType T>
T Harlinn::Math::SinH ( T x)
inlineconstexprnoexcept

Calculates the hyperbolic sine of x.

◆ SinXOverX()

template<FloatingPointType T>
T Harlinn::Math::SinXOverX ( T x)
inlineconstexpr

◆ Slerp() [1/2]

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U, SimdOrTupleType V>
requires IsCompatibleQuaternion<T, U> && ( V::Size == 4 )
auto Harlinn::Math::Slerp ( const T & q1,
const U & q2,
const V & t )
noexcept

Spherical linear interpolation between two unit quaternions.

Parameters
q1The unit quaternion to interpolate from.
q2The unit quaternion to interpolate to.
tInterpolation control factor. Every element of this vector must be set to the same value. When the elements of t is 0.0, the function returns q1, and when the elements of t is 1.0, the function returns q2.
Returns

◆ Slerp() [2/2]

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType U, ArithmeticType V>
requires IsCompatibleQuaternion<T, U>
auto Harlinn::Math::Slerp ( const T & q1,
const U & q2,
const V t )
noexcept

Spherical linear interpolation between two unit quaternions.

Parameters
q1The unit quaternion to interpolate from.
q2The unit quaternion to interpolate to.
tInterpolation control factor. When the value of t is 0.0, the function returns q1, and when the value of t is 1.0, the function returns q2.
Returns

◆ SmoothStep()

template<FloatingPointType T>
T Harlinn::Math::SmoothStep ( T x,
T a,
T b )
inlineconstexpr

◆ Sqr() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::Sqr ( const Interval< FloatT > & interval)
inlineconstexpr

◆ Sqr() [2/3]

template<SimdOrTupleType T>
auto Harlinn::Math::Sqr ( const T & t)
inlinenoexcept

Computes the square value of each element held by the argument.

◆ Sqr() [3/3]

template<typename T >
requires IsArithmetic<T> || Internal::IsComplex<T>
T Harlinn::Math::Sqr ( T v)
inlineconstexpr

◆ Sqrt() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::Sqrt ( const Interval< FloatT > & i)
inline

◆ Sqrt() [2/3]

template<SimdOrTupleType T>
auto Harlinn::Math::Sqrt ( const T & v)
inlinenoexcept

Calculates the square root of each element in the argument.

◆ Sqrt() [3/3]

template<FloatingPointType T>
T Harlinn::Math::Sqrt ( T x)
inlineconstexprnoexcept

Computes the square root of x.

The runtime performance of this implementation is equivalent to the runtime performance of std::sqrt.

Unlike std::sqrt this implementation can be constexpr evaluated.

Template Parameters
TA floating point value.
Parameters
xA floating point value.
Returns
Returns the square root of x.

◆ sqrt()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::sqrt ( const Interval< FloatT > & i)
inline

◆ SqrtAdjustDown() [1/3]

template<SimdType S>
S Harlinn::Math::SqrtAdjustDown ( const S & v)
inlinenoexcept

◆ SqrtAdjustDown() [2/3]

template<TupleType S>
S::Simd Harlinn::Math::SqrtAdjustDown ( const S & v)
inlinenoexcept

◆ SqrtAdjustDown() [3/3]

template<FloatingPointType T>
T Harlinn::Math::SqrtAdjustDown ( T a)
inlineconstexpr

◆ SqrtAdjustUp() [1/3]

template<SimdType S>
S Harlinn::Math::SqrtAdjustUp ( const S & v)
inlinenoexcept

◆ SqrtAdjustUp() [2/3]

template<TupleType S>
S::Simd Harlinn::Math::SqrtAdjustUp ( const S & v)
inlinenoexcept

◆ SqrtAdjustUp() [3/3]

template<FloatingPointType T>
T Harlinn::Math::SqrtAdjustUp ( T a)
inlineconstexpr

◆ SubAdjustDown() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::SubAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ SubAdjustDown() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::SubAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ SubAdjustDown() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::SubAdjustDown ( const S & a,
const T & b )
inlinenoexcept

◆ SubAdjustDown() [4/4]

template<FloatingPointType T>
T Harlinn::Math::SubAdjustDown ( T a,
T b )
inlineconstexpr

◆ SubAdjustUp() [1/4]

template<SimdType S, SimdType T>
requires IsCompatible<S, T>
S Harlinn::Math::SubAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ SubAdjustUp() [2/4]

template<TupleType S, SimdType T>
requires IsCompatible<S, T>
T Harlinn::Math::SubAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ SubAdjustUp() [3/4]

template<TupleType S, TupleType T>
requires IsCompatible<S, T>
S::Simd Harlinn::Math::SubAdjustUp ( const S & a,
const T & b )
inlinenoexcept

◆ SubAdjustUp() [4/4]

template<FloatingPointType T>
T Harlinn::Math::SubAdjustUp ( T a,
T b )
inlineconstexpr

◆ SubtractAngles()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::SubtractAngles ( const T & v1,
const U & v2 )
inlinenoexcept

Subtracts the angles in v2 from the corresponding elements of v1. The argument angles must be in the range [-PI,PI), and the computed angles will be in the range [-PI,PI)

◆ SumOfProducts() [1/3]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::SumOfProducts ( const Interval< FloatT > & a,
const Interval< FloatT > & b,
const Interval< FloatT > & c,
const Interval< FloatT > & d )
inline

◆ SumOfProducts() [2/3]

template<SimdTupleOrArithmeticType S, SimdOrTupleType T, SimdTupleOrArithmeticType U, SimdTupleOrArithmeticType V>
auto Harlinn::Math::SumOfProducts ( const S & v1,
const T & v2,
const U & v3,
const V & v4 )
inlinenoexcept

Calculates the sum of the product of the first and the second argument, and the product of the third and fourth argument.

◆ SumOfProducts() [3/3]

template<typename Ta , typename Tb , typename Tc , typename Td >
requires IsFloatingPoint<Ta>&& IsFloatingPoint<Tb>&& IsFloatingPoint<Tc>&& IsFloatingPoint<Td>
auto Harlinn::Math::SumOfProducts ( Ta a,
Tb b,
Tc c,
Td d )
inlineconstexpr

◆ SumSquares() [1/2]

template<typename FloatT >
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::SumSquares ( const Interval< FloatT > & i)
inline

◆ SumSquares() [2/2]

template<typename FloatT , typename... Args>
requires IsFloatingPoint<FloatT>
Interval< FloatT > Harlinn::Math::SumSquares ( const Interval< FloatT > & i,
Args... args )
inline

◆ Tan() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Tan ( const T & v)
inlinenoexcept

Calculates the tangent of each element in the argument expressed in radians.

◆ Tan() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Tan ( T x)
inlineconstexprnoexcept

Computes the tangent of x given in radians.

This implementation can be constexpr evaluated, and at runtime calls std::tan.

Template Parameters
TA floating point type.
Parameters
xA floating point value.
Returns
The tangent of x given in radians.

◆ TanH() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::TanH ( const T & v)
inlinenoexcept

Calculates the hyperbolic tangent of each element in the argument expressed in radians.

◆ TanH() [2/2]

template<FloatingPointType T>
T Harlinn::Math::TanH ( T x)
inlineconstexprnoexcept

Calculates the hyperbolic tangent of x.

◆ TGamma()

template<FloatingPointType T>
T Harlinn::Math::TGamma ( T x)
inlineconstexprnoexcept

Computes the gamma function of x.

◆ Transform() [1/18]

Normal3f::Simd Harlinn::Math::Transform ( const Normal3f & n,
const SquareMatrix< float, 3 > & matrix )
inlinenoexcept

Applies a transformation matrix to a normal.

Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [2/18]

Normal3f::Simd Harlinn::Math::Transform ( const Normal3f & n,
const SquareMatrix< float, 3 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a normal.

Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [3/18]

Normal3f::Simd Harlinn::Math::Transform ( const Normal3f::Simd & n,
const SquareMatrix< float, 3 > & matrix )
inlinenoexcept

Applies a transformation matrix to a normal.

Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [4/18]

Normal3f::Simd Harlinn::Math::Transform ( const Normal3f::Simd & n,
const SquareMatrix< float, 3 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a normal.

Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [5/18]

Normal3f::Simd Harlinn::Math::Transform ( const Normal3f::Simd & n,
const SquareMatrix< float, 4 > & matrix )
inlinenoexcept

Applies a transformation matrix to a normal.

Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [6/18]

Normal3f::Simd Harlinn::Math::Transform ( const Normal3f::Simd & n,
const SquareMatrix< float, 4 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a normal.

Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [7/18]

Plane< float >::Simd Harlinn::Math::Transform ( const Plane< float >::Simd & plane,
const SquareMatrix< float, 4 >::Simd & transformationMatrix )
inlinenoexcept

◆ Transform() [8/18]

Point2f::Simd Harlinn::Math::Transform ( const Point2f::Simd & p,
const SquareMatrix< float, 3 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a 2D coordinate.

Parameters
pThe 2D coordinate.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [9/18]

Normal3f::Simd Harlinn::Math::Transform ( const Point3f & p,
const SquareMatrix< float, 4 > & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D coordinate.

Applies a transformation matrix to a normal.

Parameters
pThe 3D coordinate.
matrixThe transformation matrix.
Returns
The transformation result.
Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [10/18]

Normal3f::Simd Harlinn::Math::Transform ( const Point3f & p,
const SquareMatrix< float, 4 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D coordinate.

Applies a transformation matrix to a normal.

Parameters
pThe 3D coordinate.
matrixThe transformation matrix.
Returns
The transformation result.
Parameters
pThe normal.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [11/18]

Point3f::Simd Harlinn::Math::Transform ( const Point3f::Simd & p,
const SquareMatrix< float, 4 > & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D coordinate.

Parameters
pThe 3D coordinate.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [12/18]

Point3f::Simd Harlinn::Math::Transform ( const Point3f::Simd & p,
const SquareMatrix< float, 4 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D coordinate.

Parameters
pThe 3D coordinate.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [13/18]

Vector< float, 2 >::Simd Harlinn::Math::Transform ( const Vector< float, 2 >::Simd & v,
const SquareMatrix< float, 3 >::Simd & matrix )
inlinenoexcept

Transforms a 2D vector by a matrix.

Parameters
v
matrix
Returns

◆ Transform() [14/18]

Vector< float, 3 >::Simd Harlinn::Math::Transform ( const Vector< float, 3 > & v,
const SquareMatrix< float, 4 > & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D vector.

Parameters
vThe vector.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [15/18]

Vector< float, 3 >::Simd Harlinn::Math::Transform ( const Vector< float, 3 > & v,
const SquareMatrix< float, 4 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D vector.

Parameters
vThe vector.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [16/18]

Vector< float, 3 >::Simd Harlinn::Math::Transform ( const Vector< float, 3 >::Simd & v,
const SquareMatrix< float, 4 > & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D vector.

Parameters
vThe vector.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [17/18]

Vector< float, 3 >::Simd Harlinn::Math::Transform ( const Vector< float, 3 >::Simd & v,
const SquareMatrix< float, 4 >::Simd & matrix )
inlinenoexcept

Applies a transformation matrix to a 3D vector.

Parameters
vThe vector.
matrixThe transformation matrix.
Returns
The transformation result.

◆ Transform() [18/18]

Vector< float, 4 >::Simd Harlinn::Math::Transform ( const Vector< float, 4 >::Simd & v,
const SquareMatrix< float, 4 >::Simd & matrix )
inlinenoexcept

◆ TransformationMatrix()

template<PointOrPointSimdType PointT, QuaternionOrQuaternionSimdType QuaternionT, VectorOrVectorSimdType VectorT>
requires ( PointT::Size == 3 ) && ( VectorT::Size == 3 ) && std::is_same_v<typename PointT::value_type, typename QuaternionT::value_type>&& std::is_same_v<typename PointT::value_type, typename VectorT::value_type>
SquareMatrix< typenamePointT::value_type, 4 >::Simd Harlinn::Math::TransformationMatrix ( const PointT & scalingOrigin,
const QuaternionT & scalingOrientationQuaternion,
const VectorT & scaling,
const PointT & rotationOrigin,
const QuaternionT & rotationQuaternion,
const VectorT & translation )
inlinenoexcept

Creates a transformation matrix.

Parameters
scalingOriginThe center of the scaling.
scalingOrientationQuaternionThe orientation of the scaling.
scalingThe scaling factors for the x-axis, y-axis, and z-axis.
rotationOriginThe center of the rotation.
rotationQuaternionThe rotation around the origin provided by rotationOrigin parameter.
translationThe translations along the x-axis, y-axis, and z-axis.
Returns
The transformation matrix.

◆ Translation() [1/3]

template<SimdType S>
requires ( S::Size > 2 ) && std::is_same_v<typename S::value_type, float>
SquareMatrix< float, 4 >::Simd Harlinn::Math::Translation ( const S & offsets)
inline

Creates a translation matrix using the provided offsets.

Parameters
offsetsTranslations along the x, y and z axis.
Returns
The translation matrix.

◆ Translation() [2/3]

SquareMatrix< float, 3 >::Simd Harlinn::Math::Translation ( float offsetX,
float offsetY )
inline

◆ Translation() [3/3]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Translation ( float offsetX,
float offsetY,
float offsetZ )
inline

Creates a translation matrix using the provided offsets.

Parameters
offsetXTranslation along the x-axis.
offsetYTranslation along the y-axis.
offsetZTranslation along the z-axis.
Returns
The translation matrix.

◆ Transpose() [1/6]

SquareMatrix< float, 2 >::Simd Harlinn::Math::Transpose ( const SquareMatrix< float, 2 > & matrix)
inline

◆ Transpose() [2/6]

SquareMatrix< float, 3 >::Simd Harlinn::Math::Transpose ( const SquareMatrix< float, 3 > & matrix)
inline

◆ Transpose() [3/6]

SquareMatrix< float, 3 >::Simd Harlinn::Math::Transpose ( const SquareMatrix< float, 3 >::Simd & matrix)
inline

◆ Transpose() [4/6]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Transpose ( const SquareMatrix< float, 4 > & matrix)
inline

Calculates the transpose of the matrix.

Parameters
matrixThe matrix to transpose.
Returns
The transposed matrix.

◆ Transpose() [5/6]

SquareMatrix< float, 4 >::Simd Harlinn::Math::Transpose ( const SquareMatrix< float, 4 >::Simd & matrix)
inline

Calculates the transpose of the matrix.

Parameters
matrixThe matrix to transpose.
Returns
The transposed matrix.

◆ Transpose() [6/6]

SquareMatrix< float, 2 >::Simd Harlinn::Math::Transpose ( const typename SquareMatrix< float, 2 >::Simd & matrix)
inline

◆ TrimmedLogistic()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
FloatT Harlinn::Math::TrimmedLogistic ( FloatT x,
FloatT s,
FloatT a,
FloatT b )
inlineconstexpr

◆ Trunc() [1/2]

template<SimdOrTupleType T>
auto Harlinn::Math::Trunc ( const T & t)
inlinenoexcept

Rounds each element held by the argument to the nearest integer in the direction of zero.

◆ Trunc() [2/2]

template<FloatingPointType T>
T Harlinn::Math::Trunc ( T value)
inlineconstexprnoexcept

Just returns value.

Computes the nearest integer not greater in magnitude than value.

Template Parameters
TA floating point type.
Parameters
valueA floating point value.
Returns
A floating point value with the nearest integer not greater in magnitude than value.
Template Parameters
TAn integer type.
Parameters
valueAn integer value.
Returns
value

◆ TwoProd()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
CompensatedFloat< FloatT > Harlinn::Math::TwoProd ( FloatT a,
FloatT b )
inlineconstexpr

◆ TwoSum()

template<typename FloatT >
requires IsFloatingPoint<FloatT>
CompensatedFloat< FloatT > Harlinn::Math::TwoSum ( FloatT a,
FloatT b )
inlineconstexpr

◆ UnitCross()

template<SimdOrTupleType T, SimdOrTupleType U>
requires IsCompatible<T, U>
auto Harlinn::Math::UnitCross ( const T & v1,
const U & v2 )
inlinenoexcept

Calculates the normalized cross product between v1 and v2.

◆ WindowedSinc()

template<FloatingPointType T>
T Harlinn::Math::WindowedSinc ( T x,
T radius,
T tau )
inlineconstexpr

◆ Y0()

template<FloatingPointType T>
T Harlinn::Math::Y0 ( T x)
inlineconstexprnoexcept

Calculates the Bessel function of the second kind of order 0 for x.

◆ Y1()

template<FloatingPointType T>
T Harlinn::Math::Y1 ( T x)
inlineconstexprnoexcept

Calculates the Bessel function of the second kind of order 1 for x.

◆ YN()

template<FloatingPointType T>
T Harlinn::Math::YN ( int n,
T x )
inlineconstexprnoexcept

Calculates the Bessel function of the second kind of order n for x.

Variable Documentation

◆ IsCompatible

template<typename T , typename ... Other>
bool Harlinn::Math::IsCompatible = ( std::is_same_v<typename T::Traits, typename Other::Traits> && ... )
constexpr

◆ IsCompatibleMatrix

template<typename T , typename ... Other>
bool Harlinn::Math::IsCompatibleMatrix = ( ( std::is_same_v<typename T::Traits, typename Other::Traits> && ( T::Size == Other::Size ) ) && ... )
constexpr

◆ IsCompatiblePlane

template<PlaneOrPlaneSimdType T, PlaneOrPlaneSimdType ... Other>
bool Harlinn::Math::IsCompatiblePlane = ( std::is_same_v<typename T::Traits, typename Other::Traits> && ... )
constexpr

◆ IsCompatibleQuaternion

template<QuaternionOrQuaternionSimdType T, QuaternionOrQuaternionSimdType ... Other>
bool Harlinn::Math::IsCompatibleQuaternion = ( std::is_same_v<typename T::Traits, typename Other::Traits> && ... )
constexpr