CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Math Namespace Reference

Namespaces

namespace  Constant
 
namespace  detail
 
namespace  impl_
 
namespace  literals
 

Classes

struct  FixedPoint
 
struct  LargeInteger
 A wide integer type that uses Hi for the high-order bits in the integer data and Lo for the low-order bits. More...
 
struct  LargeIntegerCLZHelper
 
struct  LargeIntegerCLZHelper< LargeInteger< High, Low > >
 
class  Octaves
 
class  PerlinNoise
 
struct  TAABox
 Axis aligned box represented by minimum and maximum point. More...
 
struct  TAffineTransform
 An affine transformation matrix for use in drawing 2D graphics. More...
 
struct  TCapsule
 Represents a capsule with a line segment and a radius. More...
 
class  TColor
 
struct  TConvexVolume
 Represents a convex volume defined by planes representing the volume border. More...
 
struct  TDegree
 Wrapper class which indicates a given angle value is in degrees. More...
 
struct  TExtent2
 2-Dimensional extent structure. More...
 
struct  TExtent3
 3-Dimensional extent structure. More...
 
struct  TFacing
 A structure that describes orthogonal directions. More...
 
struct  TLineSegment
 Represents a line segment in three dimensional space defined by a start and an end point. More...
 
struct  TOffset2
 2-Dimensional offset structure. More...
 
struct  TOffset3
 3-Dimensional offset structure. More...
 
struct  TPlane
 A plane represented by a normal and a distance. More...
 
struct  TRadian
 Wrapper class which indicates a given angle value is in radians. More...
 
struct  TRange
 
struct  TRay
 A ray in 3D space represented with an origin and direction. More...
 
struct  TRayIntersection
 A structure that describes an intersection with a ray. More...
 
struct  TRect
 Represents a rectangle in three dimensional space. More...
 
struct  TRect2
 Represents a 2D rectangle using real values. More...
 
struct  TRect2Edge
 
struct  TSize2
 A structure that contains width and height values. More...
 
struct  TSphere
 A sphere represented by a center point and a radius. More...
 
struct  TTransform
 A class that simplifies working with transformation matrices. More...
 

Typedefs

using Degree = TDegree< double >
 A Degree type that uses double as storage type.
 
using Degreef = TDegree< float >
 A Degree type that uses float as storage type.
 
using Radian = TRadian< double >
 A Radian type that uses double as storage type.
 
using Radianf = TRadian< float >
 A Radian type that uses float as storage type.
 
using Color = TColor< double >
 
using Colorf = TColor< float >
 
using Extent2 = TExtent2< double >
 2-Dimensional extent structure.
 
using Extent2f = TExtent2< float >
 2-Dimensional extent structure.
 
using Extent2UI = TExtent2< UInt32 >
 2-Dimensional extent structure.
 
using Extent3 = TExtent3< double >
 3-Dimensional extent structure.
 
using Extent3f = TExtent3< float >
 3-Dimensional extent structure.
 
using Fixed32x32 = FixedPoint< Int64, 32 >
 A general purpose 32.32 fixed point type.
 
using Fixed44x20 = FixedPoint< Int64, 20 >
 A general purpose 44.20 fixed point type.
 
using Fixed20x44 = FixedPoint< Int64, 44 >
 A general purpose 20.44 fixed point type.
 
using Fixed48x16 = Math::FixedPoint< Int64, 16 >
 A general purpose 48.16 fixed point type.
 
using Fixed16x48 = Math::FixedPoint< Int64, 48 >
 A general purpose 16.48 fixed point type.
 
using Fixed64x64 = FixedPoint< Int128, 64 >
 A general purpose 64.64 fixed point type.
 
using Fixed32x96 = FixedPoint< Int128, 96 >
 A general purpose 32.96 fixed point type.
 
using Fixed96x32 = FixedPoint< Int128, 32 >
 A general purpose 96.32 fixed point type.
 
using AABox = TAABox< double >
 Axis aligned box represented by minimum and maximum point.
 
using AABoxf = TAABox< float >
 Axis aligned box represented by minimum and maximum point.
 
using Capsule = TCapsule< double >
 Represents a capsule with a line segment and a radius.
 
using Capsulef = TCapsule< float >
 Represents a capsule with a line segment and a radius.
 
using ConvexVolume = TConvexVolume< double >
 Represents a convex volume defined by planes representing the volume border.
 
using ConvexVolumef = TConvexVolume< float >
 Represents a convex volume defined by planes representing the volume border.
 
using LineSegment = TLineSegment< double >
 Represents a line segment in three dimensional space defined by a start and an end point.
 
using LineSegmentf = TLineSegment< float >
 Represents a line segment in three dimensional space defined by a start and an end point.
 
using Plane = TPlane< double >
 A plane represented by a normal and a distance.
 
using Planef = TPlane< float >
 A plane represented by a normal and a distance.
 
using Ray = TRay< double >
 A ray in 3D space represented with an origin and direction.
 
using Rayf = TRay< float >
 A ray in 3D space represented with an origin and direction.
 
using RayIntersection = TRayIntersection< double >
 A structure that describes an intersection with a ray.
 
using RayIntersectionf = TRayIntersection< float >
 A structure that describes an intersection with a ray.
 
using Rect = TRect< double >
 Represents a rectangle in three dimensional space.
 
using Rectf = TRect< float >
 Represents a rectangle in three dimensional space.
 
using Sphere = TSphere< double >
 A sphere represented by a center point and a radius.
 
using Spheref = TSphere< float >
 A sphere represented by a center point and a radius.
 
using Int128 = LargeInteger< Int64 >
 An alias to a signed 128-bit integer type.
 
using UInt128 = LargeInteger< UInt64 >
 An alias to a unsigned 128-bit integer type.
 
template<glm::length_t C, glm::length_t R, typename T = double>
using TMatrix = glm::mat< C, R, T, glm::highp >
 A CxR matrix that uses a internal representation of type T.
 
template<typename T = double>
using TMatrix2 = TMatrix< 2, 2, T >
 A 2x2 type that uses a internal representation of type T
 
using Matrix2 = TMatrix2< double >
 A 2x2 matrix matrix. Data is internally represented as double.
 
using Matrix2f = TMatrix2< float >
 A 2x2 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix3 = TMatrix< 3, 3, T >
 A 3x3 type that uses a internal representation of type T
 
using Matrix3 = TMatrix3< double >
 A 3x3 matrix matrix. Data is internally represented as double.
 
using Matrix3f = TMatrix3< float >
 A 3x3 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix4 = TMatrix< 4, 4, T >
 A 4x4 type that uses a internal representation of type T
 
using Matrix4 = TMatrix4< double >
 A 4x4 matrix matrix. Data is internally represented as double.
 
using Matrix4f = TMatrix4< float >
 A 4x4 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix2x3 = TMatrix< 2, 3, T >
 A 2x3 type that uses a internal representation of type T
 
using Matrix2x3 = TMatrix2x3< double >
 A 2x3 matrix matrix. Data is internally represented as double.
 
using Matrix2x3f = TMatrix2x3< float >
 A 2x3 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix2x4 = TMatrix< 2, 4, T >
 A 2x4 type that uses a internal representation of type T
 
using Matrix2x4 = TMatrix2x4< double >
 A 2x4 matrix matrix. Data is internally represented as double.
 
using Matrix2x4f = TMatrix2x4< float >
 A 2x4 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix3x2 = TMatrix< 3, 2, T >
 A 3x2 type that uses a internal representation of type T
 
using Matrix3x2 = TMatrix3x2< double >
 A 3x2 matrix matrix. Data is internally represented as double.
 
using Matrix3x2f = TMatrix3x2< float >
 A 3x2 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix3x4 = TMatrix< 3, 4, T >
 A 3x4 type that uses a internal representation of type T
 
using Matrix3x4 = TMatrix3x4< double >
 A 3x4 matrix matrix. Data is internally represented as double.
 
using Matrix3x4f = TMatrix3x4< float >
 A 3x4 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix4x2 = TMatrix< 4, 2, T >
 A 4x2 type that uses a internal representation of type T
 
using Matrix4x2 = TMatrix4x2< double >
 A 4x2 matrix matrix. Data is internally represented as double.
 
using Matrix4x2f = TMatrix4x2< float >
 A 4x2 matrix matrix. Data is internally represented as float.
 
template<typename T = double>
using TMatrix4x3 = TMatrix< 4, 3, T >
 A 4x3 type that uses a internal representation of type T
 
using Matrix4x3 = TMatrix4x3< double >
 A 4x3 matrix matrix. Data is internally represented as double.
 
using Matrix4x3f = TMatrix4x3< float >
 A 4x3 matrix matrix. Data is internally represented as float.
 
using Offset2 = TOffset2< double >
 2-Dimensional offset structure.
 
using Offset2f = TOffset2< float >
 2-Dimensional offset structure.
 
using Offset3 = TOffset3< double >
 3-Dimensional offset structure.
 
using Offset3f = TOffset3< float >
 3-Dimensional offset structure.
 
template<typename T = double>
using TQuaternion = glm::qua< T, glm::highp >
 A quaternion type that uses a internal representation of type T
 
using Quaternion = TQuaternion< double >
 A quaternion type. Data is internally represented as double.
 
using Quaternionf = TQuaternion< float >
 A quaternion type. Data is internally represented as float.
 
using Range = TRange< double >
 
using Rangef = TRange< float >
 
using Rangei = TRange< Int64 >
 
template<typename T >
using TPoint2 = TVector2< T >
 A type that contains a point in a two-dimensional coordinate system.
 
using Point2 = TPoint2< double >
 A type that contains a point in a two-dimensional coordinate system.
 
using Size2 = TSize2< double >
 A structure that contains width and height values.
 
using Rect2Edge = TRect2Edge< double >
 
using Rect2 = TRect2< double >
 Represents a 2D rectangle using real values.
 
using AffineTransform = TAffineTransform< double >
 An affine transformation matrix for use in drawing 2D graphics.
 
using Facing = TFacing< double >
 A structure that describes orthogonal directions.
 
using Facingf = TFacing< float >
 A structure that describes orthogonal directions.
 
using Transform = TTransform< double >
 A class that simplifies working with transformation matrices.
 
using Transformf = TTransform< float >
 A class that simplifies working with transformation matrices.
 
template<glm::length_t D, typename T = double>
using TVector = glm::vec< D, T, glm::highp >
 A D-dimensional vector type that uses a internal representation of type T
 
template<typename T >
using TVector2 = TVector< 2, T >
 A two dimensional vector type that uses a internal representation of type T
 
using Vector2 = TVector2< double >
 A two dimensional vector with (x, y) coordinates.
 
using Vector2f = TVector2< float >
 A two dimensional vector with (x, y) coordinates.
 
using Vector2i = TVector2< int >
 A two dimensional vector with (x, y) coordinates.
 
using Vector2ui = TVector2< unsigned int >
 A two dimensional vector with (x, y) coordinates.
 
using Vector2b = TVector2< bool >
 A two dimensional vector with (x, y) coordinates.
 
using Vec2 = Vector2
 A alias to a Vector2.
 
using Vec2f = Vector2f
 A alias to a Vector2f.
 
template<typename T >
using TVector3 = TVector< 3, T >
 A three dimensional vector type that uses a internal representation of type T
 
using Vector3 = TVector3< double >
 A three dimensional vector with (x, y, z) coordinates.
 
using Vector3f = TVector3< float >
 A three dimensional vector with (x, y, z) coordinates.
 
using Vector3i = TVector3< int >
 A three dimensional vector with (x, y, z) coordinates.
 
using Vector3ui = TVector3< unsigned int >
 A three dimensional vector with (x, y, z) coordinates.
 
using Vector3b = TVector3< bool >
 A three dimensional vector with (x, y, z) coordinates.
 
using Vec3 = Vector3
 A alias to a Vector3.
 
using Vec3f = Vector3f
 A alias to a Vector3f.
 
template<typename T >
using TVector4 = TVector< 4, T >
 A four dimensional vector type that uses a internal representation of type T
 
using Vector4 = TVector4< double >
 A four dimensional vector with (x, y, z, w) coordinates.
 
using Vector4f = TVector4< float >
 A four dimensional vector with (x, y, z, w) coordinates.
 
using Vector4i = TVector4< int >
 A four dimensional vector with (x, y, z, w) coordinates.
 
using Vector4ui = TVector4< unsigned int >
 A four dimensional vector with (x, y, z, w) coordinates.
 
using Vector4b = TVector4< bool >
 A four dimensional vector with (x, y, z, w) coordinates.
 
using Vec4 = Vector4
 A alias to a Vector4.
 
using Vec4f = Vector4f
 A alias to a Vector4f.
 

Enumerations

enum class  FrustumPlane {
  Left = 0 , Right = 1 , Top = 2 , Bottom = 3 ,
  Far = 4 , Near = 5
}
 Clip planes that form the camera frustum (visible area). More...
 

Functions

template<CArithmetic T>
std::ostream & operator<< (std::ostream &os, const TDegree< T > &deg)
 
constexpr Degree operator""_deg (const long double degree)
 Creates a new literal degree angle by using a user-defined literal.
 
constexpr Degreef operator""_degf (const long double degree)
 Creates a new literal degree angle by using a user-defined literal.
 
template<CArithmetic T>
std::ostream & operator<< (std::ostream &os, const TRadian< T > &rad)
 
constexpr Radian operator""_rad (const long double radian)
 Creates a new literal radian angle by using a user-defined literal.
 
constexpr Radianf operator""_radf (const long double radian)
 Creates a new literal radian angle by using a user-defined literal.
 
template<typename T >
constexpr TExtent2< T > operator+ (const TExtent2< T > &lhs, const TExtent2< T > &rhs) noexcept
 Returns the sum of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr TExtent2< T > operator- (const TExtent2< T > &lhs, const TExtent2< T > &rhs) noexcept
 Returns the subtraction of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr TExtent2< T > operator* (const TExtent2< T > &lhs, T &rhs) noexcept
 Returns the multiplication of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr TExtent2< T > operator/ (const TExtent2< T > &lhs, T &rhs) noexcept
 Returns the division of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr TExtent2< T > & operator*= (TExtent2< T > &lhs, T rhs) noexcept
 Returns the multiplication of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr TExtent2< T > & operator/= (TExtent2< T > &lhs, T rhs) noexcept
 Returns the division of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr TExtent3< T > operator+ (const TExtent3< T > &lhs, const TExtent3< T > &rhs) noexcept
 Returns the sum of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr TExtent3< T > operator- (const TExtent3< T > &lhs, const TExtent3< T > &rhs) noexcept
 Returns the subtraction of left hand side extent 'lhs' and the right hand side extent 'rhs'.
 
template<typename T >
constexpr bool operator== (const TExtent2< T > &lhs, const TExtent2< T > &rhs) noexcept
 Returns true if the left hand side extent 'lhs' is equal to the right hand side extent 'rhs'.
 
template<typename T >
constexpr bool operator!= (const TExtent2< T > &lhs, const TExtent2< T > &rhs) noexcept
 Returns true if the left hand side extent 'lhs' is unequal to the right hand side extent 'rhs'.
 
template<typename T >
constexpr bool operator== (const TExtent3< T > &lhs, const TExtent3< T > &rhs) noexcept
 Returns true if the left hand side extent 'lhs' is equal to the right hand side extent 'rhs'.
 
template<typename T >
constexpr bool operator!= (const TExtent3< T > &lhs, const TExtent3< T > &rhs) noexcept
 Returns true if the left hand side extent 'lhs' is unequal to the right hand side extent 'rhs'.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator- (const FixedPoint< T, P > a) noexcept
 Converts the fixed-point number a to it's negative representation.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator+ (const FixedPoint< T, P > a) noexcept
 Converts the fixed-point number a to it's negative representation.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator+ (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Add two fixed-point numbers a and b.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator- (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Subtract two fixed-point numbers a and b.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator* (const FixedPoint< T, P > x, const typename FixedPoint< T, P >::Self y) noexcept
 Multiply two fixed-point numbers a and b.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator/ (const FixedPoint< T, P > x, const typename FixedPoint< T, P >::Self y) noexcept
 Divide two fixed-point numbers a and b.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & operator+= (FixedPoint< T, P > &a, const typename FixedPoint< T, P >::Self b) noexcept
 Add two fixed-point numbers a and b and assigns the resulting value into a.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & operator++ (FixedPoint< T, P > &a) noexcept
 Increment the fixed-point value by adding 1.0 to it.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator++ (FixedPoint< T, P > &a, int) noexcept
 Increment the fixed-point value by adding 1.0 to it.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & operator-= (FixedPoint< T, P > &a, const typename FixedPoint< T, P >::Self b) noexcept
 Subtract two fixed-point numbers a and b and assigns the resulting value into a.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & operator-- (FixedPoint< T, P > &a) noexcept
 Decrement the fixed-point value by subtracting 1.0 from it.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > operator-- (FixedPoint< T, P > &a, int) noexcept
 Decrement the fixed-point value by subtracting 1.0 from it.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & operator*= (FixedPoint< T, P > &a, const typename FixedPoint< T, P >::Self b) noexcept
 Multiply two fixed-point numbers a and b and assigns the resulting value into a.
 
template<typename T , unsigned int P>
constexpr bool operator== (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Compares two fixed-pointer numbers for equality.
 
template<typename T , unsigned int P>
constexpr bool operator!= (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Compares two fixed-pointer numbers for inequality.
 
template<typename T , unsigned int P>
constexpr bool operator< (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr bool operator< (const FixedPoint< T, P > a, double b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr bool operator<= (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr bool operator<= (const FixedPoint< T, P > a, double b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr bool operator> (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr bool operator> (const FixedPoint< T, P > a, double b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr bool operator>= (const FixedPoint< T, P > a, const typename FixedPoint< T, P >::Self b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr bool operator>= (const FixedPoint< T, P > a, double b) noexcept
 Compares two fixed-pointer numbers.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > abs (const FixedPoint< T, P > &x)
 Returns the absolute value of a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > frac (const FixedPoint< T, P > &x)
 Returns the fractional portion of a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > sign (const FixedPoint< T, P > &x)
 Returns sign of scalar a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > floor (const FixedPoint< T, P > &x)
 Returns largest integer not greater than a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > ceil (const FixedPoint< T, P > &x)
 Returns smallest integer not less than a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > round (const FixedPoint< T, P > &x)
 Returns the rounded value a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > sqrt (const FixedPoint< T, P > &x)
 Returns square root of a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > acos (FixedPoint< T, P > x)
 Returns arccosine of a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > asin (FixedPoint< T, P > x)
 Returns arcsine of a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > atan2 (const FixedPoint< T, P > &y, const FixedPoint< T, P > &x)
 Returns arctangent of a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > atan (const FixedPoint< T, P > &x)
 Returns arctangent of a fixed-point value.
 
template<typename B , unsigned int F>
constexpr FixedPoint< B, F > fmod (FixedPoint< B, F > x, FixedPoint< B, F > y) noexcept
 
template<typename B , unsigned int F>
FixedPoint< B, F > sin (FixedPoint< B, F > x) noexcept
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > cos (const FixedPoint< T, P > &x)
 Returns cosine of a fixed-point value.
 
template<typename T , unsigned int P>
constexpr FixedPoint< T, P > tan (const FixedPoint< T, P > &x)
 Returns tangent of a fixed-point value. Returns the tangent of a in radians.
 
constexpr FixedPoint< Int64, sizeof(Int64) *8 - std::numeric_limits< double >::digits > operator""_fp (const long double v)
 Creates a new fixed-point number from an literal floating-point value.
 
template<typename T >
bool approxEquals (T a, T b, T tolerance=std::numeric_limits< T >::epsilon())
 Compare two doubles, using tolerance for inaccuracies.
 
template<typename T >
bool nearZero (T a, T tolerance=T(1e-8))
 Return true iff a is almost zero.
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const TAABox< T > &box)
 Prints a string representation of the AABox.
 
template std::ostream & operator<< (std::ostream &os, const TAABox< double > &box)
 
template std::ostream & operator<< (std::ostream &os, const TAABox< float > &box)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const TRay< T > &ray)
 Prints a string representation of the Ray.
 
template std::ostream & operator<< (std::ostream &, const TRay< double > &)
 
template std::ostream & operator<< (std::ostream &, const TRay< float > &)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const TRayIntersection< T > &intersection)
 Prints a string representation of the RayIntersection.
 
template std::ostream & operator<< (std::ostream &, const TRayIntersection< double > &)
 
template std::ostream & operator<< (std::ostream &, const TRayIntersection< float > &)
 
template<typename T >
constexpr void multwide (T a, T b, T &hi, T &lo)
 
template<typename T >
constexpr void multwide (LargeInteger< T, T > a, LargeInteger< T, T > b, LargeInteger< T, T > &hi, LargeInteger< T, T > &lo)
 
template<typename T >
constexpr void mult128 (T N, T M, T &Ans)
 
template<typename U >
constexpr void mult128to256 (U N, U M, U &H, U &L)
 
template<char... _Args>
constexpr UInt128 operator""_u128 ()
 
template<char... _Args>
constexpr Int128 operator""_i128 ()
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator+ (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Add two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator- (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Subtracts two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator* (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Multiplies two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator/ (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Divides two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator% (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Calculates the module two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator& (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Bitwise and a large integer rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator| (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Bitwise or a large integer rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator^ (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Bitwise xor a large integer rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator<< (LargeInteger< Hi, Low > lhs, int rhs) noexcept
 Left shifts rhs bits from lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator>> (LargeInteger< Hi, Low > lhs, int rhs) noexcept
 Right shifts rhs bits from lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator+ (LargeInteger< Hi, Low > lhs) noexcept
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator- (LargeInteger< Hi, Low > lhs) noexcept
 Inverts the signal of a large integer rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > operator~ (LargeInteger< Hi, Low > lhs) noexcept
 Bitwise negates a large integer rhs.
 
template<typename Hi , typename Low >
constexpr bool operator! (LargeInteger< Hi, Low > lhs) noexcept
 Logically negates a large integer rhs.
 
template<typename Hi , typename Low >
LargeInteger< Hi, Low > & operator++ (LargeInteger< Hi, Low > &lhs) noexcept
 Increments a large integer lhs by 1.
 
template<typename Hi , typename Low >
LargeInteger< Hi, Low > operator++ (LargeInteger< Hi, Low > &lhs, int) noexcept
 Increments a large integer lhs by 1.
 
template<typename Hi , typename Low >
LargeInteger< Hi, Low > & operator-- (LargeInteger< Hi, Low > &lhs) noexcept
 Decrements a large integer lhs by 1.
 
template<typename Hi , typename Low >
LargeInteger< Hi, Low > operator-- (LargeInteger< Hi, Low > &lhs, int) noexcept
 Decrements a large integer lhs by 1.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator+= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Add two large integer numbers lhs and rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator-= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Subtract two large integer numbers lhs and rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator*= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Multiply two large integer numbers lhs and rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator/= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Divide two large integer numbers lhs and rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator%= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Calculates the remainder of the division of two large integer numbers lhs and rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator<<= (LargeInteger< Hi, Low > &lhs, int rhs) noexcept
 Left shifts rhs bits from lhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator>>= (LargeInteger< Hi, Low > &lhs, int rhs) noexcept
 Right shifts rhs bits from lhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator&= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Bitwise and a large integer rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator|= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Bitwise or a large integer rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & operator^= (LargeInteger< Hi, Low > &lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Bitwise xor a large integer rhs in-place in lhs.
 
template<typename Hi , typename Low >
constexpr bool operator== (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Compares two large integer numbers lhs and rhs for equality.
 
template<typename Hi , typename Low >
constexpr bool operator!= (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Compares two large integer numbers lhs and rhs for inequality.
 
template<typename Hi , typename Low >
constexpr bool operator< (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Compares two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr bool operator<= (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Compares two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr bool operator> (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Compares two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr bool operator>= (LargeInteger< Hi, Low > lhs, typename LargeInteger< Hi, Low >::Self rhs) noexcept
 Compares two large integer numbers lhs and rhs.
 
template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > abs (LargeInteger< Hi, Low > x)
 Returns the absolute value of x: |x|.
 
template<typename T >
TMatrix4< T > constexpr flipProjectionY (TMatrix4< T > proj) noexcept
 
template<typename T >
constexpr TMatrix4< T > frustum (T left, T right, T bottom, T top, T zNear, T zFar) noexcept
 Creates a frustum matrix with default handedness, using the default handedness and default near and far clip planes definition.
 
template<typename T >
constexpr TMatrix4< T > perspective (T fovy, T aspect, T zNear, T zFar) noexcept
 Creates a matrix for a symetric perspective-view frustum based on the default handedness and default near and far clip planes definition.
 
template<typename T >
constexpr TMatrix4< T > perspectiveFov (T fov, T width, T height, T zNear, T zFar) noexcept
 Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition.
 
template<typename T >
constexpr TMatrix4< T > infinitePerspective (T fovy, T aspect, T zNear) noexcept
 Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness.
 
template<typename T >
constexpr TMatrix4< T > tweakedInfinitePerspective (T fovy, T aspect, T zNear) noexcept
 Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
 
template<typename T >
constexpr TMatrix4< T > tweakedInfinitePerspective (T fovy, T aspect, T zNear, T ep) noexcept
 Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
 
template<typename T >
constexpr TMatrix4< T > ortho (T left, T right, T bottom, T top, T zNear, T zFar)
 Creates a matrix for projecting two-dimensional coordinates onto the screen.
 
template<typename T >
double smoothStep (T val1, T val2, T t)
 Performs smooth Hermite interpolation between values.
 
template<typename T >
quintic (T val)
 Performs quintic interpolation where val is the value to map onto a quintic S-curve.
 
template<typename T , typename U >
auto cubic (T val1, T val2, T val3, T val4, U f)
 Performs cubic interpolation between two values bound between two other values where f is the alpha value.
 
template<typename T , glm::length_t D>
bool approxEquals (const TVector< D, T > &a, const TVector< D, T > &b, T tolerance=std::numeric_limits< T >::epsilon())
 Compare two vectors, using tolerance for inaccuracies.
 
template<typename T , glm::length_t D>
bool approxEquals (const TVector< D, T > &a, T b, T tolerance=std::numeric_limits< T >::epsilon())
 Compare two vectors, using tolerance for inaccuracies.
 
template<typename T >
bool approxEquals (const TQuaternion< T > &a, const TQuaternion< T > &b, T tolerance=std::numeric_limits< T >::epsilon())
 Compare two quaternions, using tolerance for inaccuracies.
 
template<typename T >
lerp (T t, T min, T max)
 Linearly interpolates between the two values using t.
 
template<typename T >
invLerp (T val, T min, T max)
 Determines the position of a value between two other values.
 
template<typename A , typename B >
std::common_type_t< A, B > gcd (const A &a, const B &b)
 Return the greater common divisor between two values.
 
template<typename A , typename B >
std::common_type_t< A, B > lcm (const A &a, const B &b)
 Return the least common multiple between two values.
 
template<typename T >
int solveLinear (T A, T B, T *roots)
 Solves the linear equation with the parameters A, B.
 
template<typename T >
int solveQuadratic (T A, T B, T C, T *roots)
 Solves the quadratic equation with the parameters A, B, C.
 
template<typename T >
int solveCubic (T A, T B, T C, T D, T *roots)
 Solves the cubic equation with the parameters A, B, C, D.
 
template<typename T >
int solveQuartic (T A, T B, T C, T D, T E, T *roots)
 Solves the quartic equation with the parameters A, B, C, D, E.
 
template<class T >
cubicHermite (const double t, const T &pointA, const T &pointB, const T &tangentA, const T &tangentB)
 Evaluates a cubic Hermite curve at a specific point.
 
template<class T >
cubicHermiteD1 (const double t, const T &pointA, const T &pointB, const T &tangentA, const T &tangentB)
 Evaluates the first derivative of a cubic Hermite curve at a specific point.
 
template<class T >
Array< T, 4 > cubicHermiteCoefficients (const T &pointA, const T &pointB, const T &tangentA, const T &tangentB)
 Calculates coefficients needed for evaluating a cubic curve in Hermite form.
 
template<class T , typename L >
Array< T, 4 > cubicHermiteCoefficients (const T &pointA, const T &pointB, const T &tangentA, const T &tangentB, L length)
 Calculates coefficients needed for evaluating a cubic curve in Hermite form.
 
template<typename T , typename Integrand >
rombergIntegration (T a, T b, int order, Integrand &&integrand)
 Calculates the Romberg Integration.
 
template<typename T , typename Integrand >
gaussianQuadrature (T a, T b, T *roots, T *coefficients, Integrand &&integrand)
 Calculates the Gaussian Quadrature.
 
template<typename T >
haltonSequence (int index, int base)
 Generates numbers in a deterministic sequence suitable for Monte Carlo algorithms.
 
template<typename T >
angle (const TVector2< T > &v1, const TVector2< T > &v2)
 
template<typename T >
angle (const TVector3< T > &v1, const TVector3< T > &v2)
 
template<typename T >
TVector2< T > cross (const TVector2< T > &v)
 
template<typename T >
TVector3< T > transform (const TQuaternion< T > &q, const TVector3< T > &v)
 
template<typename T >
TQuaternion< T > qrotate (const T &angle, const TVector3< T > &axis)
 
template<typename T >
TVector3< T > normal (const TVector3< T > &p1, const TVector3< T > &p2, const TVector3< T > &p3)
 
template<typename T , typename TI , typename TS >
TVector3< T > project (const TVector3< T > &v, const TMatrix4< T > &modelViewProj, const TVector2< TI > &viewportOrigin, const TVector2< TS > &viewportSize)
 
template<typename T >
TMatrix4< T > ortho2D (const T &left, const T &right, const T &bottom, const T &top)
 
template<typename T >
TVector3< T > slerp (const TVector3< T > &v1, const TVector3< T > &v2, const T &a)
 
template<typename T >
TMatrix4< T > rotate (const TVector3< T > &angle)
 
template<typename T >
TMatrix3< T > rotate (const T &angle)
 
template<typename T >
TVector2< T > transform (const TMatrix3< T > &m, const TVector2< T > &v)
 
template<int D, typename T >
TVector2< T > bezier (const TVector2< T >(&p)[D], T t)
 
template<int D, typename T >
TVector3< T > bezier (const TVector3< T >(&p)[D], T t)
 
template<int D0, int D1, typename T >
TVector3< T > bezier2 (const TVector3< T >(&p)[D1][D0], const TVector2< T > &t)
 
template<int O, int D, typename T >
TVector2< T > bezierDerivative (const TVector2< T >(&p)[D], T t)
 
template<int O, int D, typename T >
TVector3< T > bezierDerivative (const TVector3< T >(&p)[D], T t)
 
template<int O, int D0, int D1, typename T >
TMatrix2x3< T > bezier2Jacobian (const TVector3< T >(&p)[D1][D0], const TVector2< T > &t)
 
template<typename T >
constexpr TOffset2< T > operator+ (const TOffset2< T > &lhs, const TOffset2< T > &rhs) noexcept
 Returns the sum of left hand side offset 'lhs' and the right hand side offset 'rhs'.
 
template<typename T >
constexpr TOffset2< T > operator- (const TOffset2< T > &lhs, const TOffset2< T > &rhs) noexcept
 Returns the subtraction of left hand side offset 'lhs' and the right hand side offset 'rhs'.
 
template<typename T >
constexpr TOffset3< T > operator+ (const TOffset3< T > &lhs, const TOffset3< T > &rhs) noexcept
 Returns the sum of left hand side offset 'lhs' and the right hand side offset 'rhs'.
 
template<typename T >
constexpr TOffset3< T > operator- (const TOffset3< T > &lhs, const TOffset3< T > &rhs) noexcept
 Returns the subtraction of left hand side offset 'lhs' and the right hand side offset 'rhs'.
 
template<typename T >
constexpr bool operator== (const TOffset2< T > &lhs, const TOffset2< T > &rhs) noexcept
 Returns true if the left hand side offset 'lhs' is equal to the right hand side offset 'rhs'.
 
template<typename T >
constexpr bool operator!= (const TOffset2< T > &lhs, const TOffset2< T > &rhs) noexcept
 Returns true if the left hand side offset 'lhs' is unequal to the right hand side offset 'rhs'.
 
template<typename T >
constexpr bool operator== (const TOffset3< T > &lhs, const TOffset3< T > &rhs) noexcept
 Returns true if the left hand side offset 'lhs' is equal to the right hand side offset 'rhs'.
 
template<typename T >
constexpr bool operator!= (const TOffset3< T > &lhs, const TOffset3< T > &rhs) noexcept
 Returns true if the left hand side offset 'lhs' is unequal to the right hand side offset 'rhs'.
 
template<typename OffsetT , typename LengthT >
constexpr TRange< OffsetT, LengthT > operator& (TRange< OffsetT, LengthT > a, TRange< OffsetT, LengthT > b) noexcept
 Computes the intersection of both ranges a and b.
 
template<typename OffsetT , typename LengthT >
constexpr bool operator== (TRange< OffsetT, LengthT > a, TRange< OffsetT, LengthT > b) noexcept
 Compares two ranges for equality.
 
template<typename OffsetT , typename LengthT >
constexpr bool operator!= (TRange< OffsetT, LengthT > a, TRange< OffsetT, LengthT > b) noexcept
 Compares two ranges for inequality.
 
template<typename OffsetT , typename LengthT >
constexpr bool operator< (decltype(TRange< OffsetT, LengthT >::offset) offset, TRange< OffsetT, LengthT > range) noexcept
 Checks if a offset is before the range.
 
template<typename OffsetT , typename LengthT >
constexpr bool operator<= (decltype(TRange< OffsetT, LengthT >::offset) offset, TRange< OffsetT, LengthT > range) noexcept
 Checks if a offset is before the range or is within the range.
 
template<typename OffsetT , typename LengthT >
constexpr bool operator> (decltype(TRange< OffsetT, LengthT >::offset) offset, TRange< OffsetT, LengthT > range) noexcept
 Checks if a offset is after the range.
 
template<typename OffsetT , typename LengthT >
constexpr bool operator>= (decltype(TRange< OffsetT, LengthT >::offset) offset, TRange< OffsetT, LengthT > range) noexcept
 Checks if a offset is after the range or is within the range.
 
template<typename T >
constexpr T MinX (const TRect2< T > &rect)
 
template<typename T >
constexpr T MinY (const TRect2< T > &rect)
 
template<typename T >
constexpr T Width (const TRect2< T > &rect)
 
template<typename T >
constexpr T Height (const TRect2< T > &rect)
 
template<typename T >
constexpr T MaxX (const TRect2< T > &rect)
 
template<typename T >
constexpr T MaxY (const TRect2< T > &rect)
 
template<typename T >
constexpr T MidX (const TRect2< T > &rect)
 
template<typename T >
constexpr T MidY (const TRect2< T > &rect)
 
template<std::size_t N, glm::length_t D, typename T >
T & get (TVector< D, T > &vector) noexcept
 Decomposes a vector into one of it's components.
 
template<std::size_t N, glm::length_t D, typename T >
const T & get (const TVector< D, T > &vector) noexcept
 Decomposes a vector into one of it's components.
 

Typedef Documentation

◆ AABox

using Math::AABox = typedef TAABox<double>

Axis aligned box represented by minimum and maximum point.

◆ AABoxf

using Math::AABoxf = typedef TAABox<float>

Axis aligned box represented by minimum and maximum point.

◆ AffineTransform

using Math::AffineTransform = typedef TAffineTransform<double>

An affine transformation matrix for use in drawing 2D graphics.

An affine transformation matrix is used to rotate, scale, translate, or skew the objects you draw in a graphics context. The TAffineTransform type provides functions for creating, concatenating, and applying affine transformations.

Affine transforms are represented by a 3 by 3 matrix.

◆ Capsule

using Math::Capsule = typedef TCapsule<double>

Represents a capsule with a line segment and a radius.

◆ Capsulef

using Math::Capsulef = typedef TCapsule<float>

Represents a capsule with a line segment and a radius.

◆ Color

using Math::Color = typedef TColor<double>

◆ Colorf

using Math::Colorf = typedef TColor<float>

◆ ConvexVolume

using Math::ConvexVolume = typedef TConvexVolume<double>

Represents a convex volume defined by planes representing the volume border.

◆ ConvexVolumef

using Math::ConvexVolumef = typedef TConvexVolume<float>

Represents a convex volume defined by planes representing the volume border.

◆ Degree

using Math::Degree = typedef TDegree<double>

A Degree type that uses double as storage type.

◆ Degreef

using Math::Degreef = typedef TDegree<float>

A Degree type that uses float as storage type.

◆ Extent2

using Math::Extent2 = typedef TExtent2<double>

2-Dimensional extent structure.

Remarks
Used for unsigned integral 2D extents (for sizes in window- space, screen-space, and texture-space).

◆ Extent2f

using Math::Extent2f = typedef TExtent2<float>

2-Dimensional extent structure.

Remarks
Used for unsigned integral 2D extents (for sizes in window- space, screen-space, and texture-space).

◆ Extent2UI

using Math::Extent2UI = typedef TExtent2<UInt32>

2-Dimensional extent structure.

Remarks
Used for unsigned integral 2D extents (for sizes in window- space, screen-space, and texture-space).

◆ Extent3

using Math::Extent3 = typedef TExtent3<double>

3-Dimensional extent structure.

Remarks
Used for unsigned integral 3D extents (for sizes in texture- space).

◆ Extent3f

using Math::Extent3f = typedef TExtent3<float>

3-Dimensional extent structure.

Remarks
Used for unsigned integral 3D extents (for sizes in texture- space).

◆ Facing

using Math::Facing = typedef TFacing<double>

A structure that describes orthogonal directions.

◆ Facingf

using Math::Facingf = typedef TFacing<float>

A structure that describes orthogonal directions.

◆ Fixed16x48

using Math::Fixed16x48 = typedef Math::FixedPoint<Int64, 48>

A general purpose 16.48 fixed point type.

◆ Fixed20x44

using Math::Fixed20x44 = typedef FixedPoint<Int64, 44>

A general purpose 20.44 fixed point type.

◆ Fixed32x32

using Math::Fixed32x32 = typedef FixedPoint<Int64, 32>

A general purpose 32.32 fixed point type.

◆ Fixed32x96

using Math::Fixed32x96 = typedef FixedPoint<Int128, 96>

A general purpose 32.96 fixed point type.

◆ Fixed44x20

using Math::Fixed44x20 = typedef FixedPoint<Int64, 20>

A general purpose 44.20 fixed point type.

◆ Fixed48x16

using Math::Fixed48x16 = typedef Math::FixedPoint<Int64, 16>

A general purpose 48.16 fixed point type.

◆ Fixed64x64

using Math::Fixed64x64 = typedef FixedPoint<Int128, 64>

A general purpose 64.64 fixed point type.

◆ Fixed96x32

using Math::Fixed96x32 = typedef FixedPoint<Int128, 32>

A general purpose 96.32 fixed point type.

◆ Int128

using Math::Int128 = typedef LargeInteger<Int64>

An alias to a signed 128-bit integer type.

◆ LineSegment

using Math::LineSegment = typedef TLineSegment<double>

Represents a line segment in three dimensional space defined by a start and an end point.

◆ LineSegmentf

using Math::LineSegmentf = typedef TLineSegment<float>

Represents a line segment in three dimensional space defined by a start and an end point.

◆ Matrix2

using Math::Matrix2 = typedef TMatrix2<double>

A 2x2 matrix matrix. Data is internally represented as double.

◆ Matrix2f

using Math::Matrix2f = typedef TMatrix2<float>

A 2x2 matrix matrix. Data is internally represented as float.

◆ Matrix2x3

using Math::Matrix2x3 = typedef TMatrix2x3<double>

A 2x3 matrix matrix. Data is internally represented as double.

◆ Matrix2x3f

using Math::Matrix2x3f = typedef TMatrix2x3<float>

A 2x3 matrix matrix. Data is internally represented as float.

◆ Matrix2x4

using Math::Matrix2x4 = typedef TMatrix2x4<double>

A 2x4 matrix matrix. Data is internally represented as double.

◆ Matrix2x4f

using Math::Matrix2x4f = typedef TMatrix2x4<float>

A 2x4 matrix matrix. Data is internally represented as float.

◆ Matrix3

using Math::Matrix3 = typedef TMatrix3<double>

A 3x3 matrix matrix. Data is internally represented as double.

◆ Matrix3f

using Math::Matrix3f = typedef TMatrix3<float>

A 3x3 matrix matrix. Data is internally represented as float.

◆ Matrix3x2

using Math::Matrix3x2 = typedef TMatrix3x2<double>

A 3x2 matrix matrix. Data is internally represented as double.

◆ Matrix3x2f

using Math::Matrix3x2f = typedef TMatrix3x2<float>

A 3x2 matrix matrix. Data is internally represented as float.

◆ Matrix3x4

using Math::Matrix3x4 = typedef TMatrix3x4<double>

A 3x4 matrix matrix. Data is internally represented as double.

◆ Matrix3x4f

using Math::Matrix3x4f = typedef TMatrix3x4<float>

A 3x4 matrix matrix. Data is internally represented as float.

◆ Matrix4

using Math::Matrix4 = typedef TMatrix4<double>

A 4x4 matrix matrix. Data is internally represented as double.

◆ Matrix4f

using Math::Matrix4f = typedef TMatrix4<float>

A 4x4 matrix matrix. Data is internally represented as float.

◆ Matrix4x2

using Math::Matrix4x2 = typedef TMatrix4x2<double>

A 4x2 matrix matrix. Data is internally represented as double.

◆ Matrix4x2f

using Math::Matrix4x2f = typedef TMatrix4x2<float>

A 4x2 matrix matrix. Data is internally represented as float.

◆ Matrix4x3

using Math::Matrix4x3 = typedef TMatrix4x3<double>

A 4x3 matrix matrix. Data is internally represented as double.

◆ Matrix4x3f

using Math::Matrix4x3f = typedef TMatrix4x3<float>

A 4x3 matrix matrix. Data is internally represented as float.

◆ Offset2

using Math::Offset2 = typedef TOffset2<double>

2-Dimensional offset structure.

Remarks
Used for signed integral 2D offsets (for coordinates in window- space, screen-space, and texture-space).

◆ Offset2f

using Math::Offset2f = typedef TOffset2<float>

2-Dimensional offset structure.

Remarks
Used for signed integral 2D offsets (for coordinates in window- space, screen-space, and texture-space).

◆ Offset3

using Math::Offset3 = typedef TOffset3<double>

3-Dimensional offset structure.

Remarks
Used for signed integral 3D offsets (for coordinates in texture-space).

◆ Offset3f

using Math::Offset3f = typedef TOffset3<float>

3-Dimensional offset structure.

Remarks
Used for signed integral 3D offsets (for coordinates in texture-space).

◆ Plane

using Math::Plane = typedef TPlane<double>

A plane represented by a normal and a distance.

◆ Planef

using Math::Planef = typedef TPlane<float>

A plane represented by a normal and a distance.

◆ Point2

using Math::Point2 = typedef TPoint2<double>

A type that contains a point in a two-dimensional coordinate system.

◆ Quaternion

using Math::Quaternion = typedef TQuaternion<double>

A quaternion type. Data is internally represented as double.

◆ Quaternionf

using Math::Quaternionf = typedef TQuaternion<float>

A quaternion type. Data is internally represented as float.

◆ Radian

using Math::Radian = typedef TRadian<double>

A Radian type that uses double as storage type.

◆ Radianf

using Math::Radianf = typedef TRadian<float>

A Radian type that uses float as storage type.

◆ Range

using Math::Range = typedef TRange<double>

◆ Rangef

using Math::Rangef = typedef TRange<float>

◆ Rangei

using Math::Rangei = typedef TRange<Int64>

◆ Ray

using Math::Ray = typedef TRay<double>

A ray in 3D space represented with an origin and direction.

◆ Rayf

using Math::Rayf = typedef TRay<float>

A ray in 3D space represented with an origin and direction.

◆ RayIntersection

using Math::RayIntersection = typedef TRayIntersection<double>

A structure that describes an intersection with a ray.

◆ RayIntersectionf

using Math::RayIntersectionf = typedef TRayIntersection<float>

A structure that describes an intersection with a ray.

◆ Rect

using Math::Rect = typedef TRect<double>

Represents a rectangle in three dimensional space.

It is represented by two axes that extend from the specified origin. Axes should be perpendicular to each other and they extend in both positive and negative directions from the origin by the amount specified by extents.

◆ Rect2

using Math::Rect2 = typedef TRect2<double>

Represents a 2D rectangle using real values.

Rectangle is represented with an origin in top left and width/height.

◆ Rect2Edge

using Math::Rect2Edge = typedef TRect2Edge<double>

◆ Rectf

using Math::Rectf = typedef TRect<float>

Represents a rectangle in three dimensional space.

It is represented by two axes that extend from the specified origin. Axes should be perpendicular to each other and they extend in both positive and negative directions from the origin by the amount specified by extents.

◆ Size2

using Math::Size2 = typedef TSize2<double>

A structure that contains width and height values.

◆ Sphere

using Math::Sphere = typedef TSphere<double>

A sphere represented by a center point and a radius.

◆ Spheref

using Math::Spheref = typedef TSphere<float>

A sphere represented by a center point and a radius.

◆ TMatrix

template<glm::length_t C, glm::length_t R, typename T = double>
using Math::TMatrix = typedef glm::mat<C, R, T, glm::highp>

A CxR matrix that uses a internal representation of type T.

◆ TMatrix2

template<typename T = double>
using Math::TMatrix2 = typedef TMatrix<2, 2, T>

A 2x2 type that uses a internal representation of type T

◆ TMatrix2x3

template<typename T = double>
using Math::TMatrix2x3 = typedef TMatrix<2, 3, T>

A 2x3 type that uses a internal representation of type T

◆ TMatrix2x4

template<typename T = double>
using Math::TMatrix2x4 = typedef TMatrix<2, 4, T>

A 2x4 type that uses a internal representation of type T

◆ TMatrix3

template<typename T = double>
using Math::TMatrix3 = typedef TMatrix<3, 3, T>

A 3x3 type that uses a internal representation of type T

◆ TMatrix3x2

template<typename T = double>
using Math::TMatrix3x2 = typedef TMatrix<3, 2, T>

A 3x2 type that uses a internal representation of type T

◆ TMatrix3x4

template<typename T = double>
using Math::TMatrix3x4 = typedef TMatrix<3, 4, T>

A 3x4 type that uses a internal representation of type T

◆ TMatrix4

template<typename T = double>
using Math::TMatrix4 = typedef TMatrix<4, 4, T>

A 4x4 type that uses a internal representation of type T

◆ TMatrix4x2

template<typename T = double>
using Math::TMatrix4x2 = typedef TMatrix<4, 2, T>

A 4x2 type that uses a internal representation of type T

◆ TMatrix4x3

template<typename T = double>
using Math::TMatrix4x3 = typedef TMatrix<4, 3, T>

A 4x3 type that uses a internal representation of type T

◆ TPoint2

template<typename T >
using Math::TPoint2 = typedef TVector2<T>

A type that contains a point in a two-dimensional coordinate system.

◆ TQuaternion

template<typename T = double>
using Math::TQuaternion = typedef glm::qua<T, glm::highp>

A quaternion type that uses a internal representation of type T

◆ Transform

using Math::Transform = typedef TTransform<double>

A class that simplifies working with transformation matrices.

Template Parameters
TThe scalar type used by the transform.

◆ Transformf

using Math::Transformf = typedef TTransform<float>

A class that simplifies working with transformation matrices.

Template Parameters
TThe scalar type used by the transform.

◆ TVector

template<glm::length_t D, typename T = double>
using Math::TVector = typedef glm::vec<D, T, glm::highp>

A D-dimensional vector type that uses a internal representation of type T

◆ TVector2

template<typename T >
using Math::TVector2 = typedef TVector<2, T>

A two dimensional vector type that uses a internal representation of type T

◆ TVector3

template<typename T >
using Math::TVector3 = typedef TVector<3, T>

A three dimensional vector type that uses a internal representation of type T

◆ TVector4

template<typename T >
using Math::TVector4 = typedef TVector<4, T>

A four dimensional vector type that uses a internal representation of type T

◆ UInt128

using Math::UInt128 = typedef LargeInteger<UInt64>

An alias to a unsigned 128-bit integer type.

◆ Vec2

using Math::Vec2 = typedef Vector2

A alias to a Vector2.

◆ Vec2f

using Math::Vec2f = typedef Vector2f

A alias to a Vector2f.

◆ Vec3

using Math::Vec3 = typedef Vector3

A alias to a Vector3.

◆ Vec3f

using Math::Vec3f = typedef Vector3f

A alias to a Vector3f.

◆ Vec4

using Math::Vec4 = typedef Vector4

A alias to a Vector4.

◆ Vec4f

using Math::Vec4f = typedef Vector4f

A alias to a Vector4f.

◆ Vector2

using Math::Vector2 = typedef TVector2<double>

A two dimensional vector with (x, y) coordinates.

◆ Vector2b

using Math::Vector2b = typedef TVector2<bool>

A two dimensional vector with (x, y) coordinates.

Data is internally represented as bool.

◆ Vector2f

using Math::Vector2f = typedef TVector2<float>

A two dimensional vector with (x, y) coordinates.

Data is internally represented as float.

◆ Vector2i

using Math::Vector2i = typedef TVector2<int>

A two dimensional vector with (x, y) coordinates.

Data is internally represented as unsigned int.

◆ Vector2ui

using Math::Vector2ui = typedef TVector2<unsigned int>

A two dimensional vector with (x, y) coordinates.

Data is internally represented as unsigned int.

◆ Vector3

using Math::Vector3 = typedef TVector3<double>

A three dimensional vector with (x, y, z) coordinates.

◆ Vector3b

using Math::Vector3b = typedef TVector3<bool>

A three dimensional vector with (x, y, z) coordinates.

Data is internally represented as bool.

◆ Vector3f

using Math::Vector3f = typedef TVector3<float>

A three dimensional vector with (x, y, z) coordinates.

Data is internally represented as float.

◆ Vector3i

using Math::Vector3i = typedef TVector3<int>

A three dimensional vector with (x, y, z) coordinates.

Data is internally represented as unsigned int.

◆ Vector3ui

using Math::Vector3ui = typedef TVector3<unsigned int>

A three dimensional vector with (x, y, z) coordinates.

Data is internally represented as unsigned int.

◆ Vector4

using Math::Vector4 = typedef TVector4<double>

A four dimensional vector with (x, y, z, w) coordinates.

◆ Vector4b

using Math::Vector4b = typedef TVector4<bool>

A four dimensional vector with (x, y, z, w) coordinates.

Data is internally represented as bool.

◆ Vector4f

using Math::Vector4f = typedef TVector4<float>

A four dimensional vector with (x, y, z, w) coordinates.

Data is internally represented as float.

◆ Vector4i

using Math::Vector4i = typedef TVector4<int>

A four dimensional vector with (x, y, z, w) coordinates.

Data is internally represented as unsigned int.

◆ Vector4ui

using Math::Vector4ui = typedef TVector4<unsigned int>

A four dimensional vector with (x, y, z, w) coordinates.

Data is internally represented as unsigned int.

Enumeration Type Documentation

◆ FrustumPlane

enum class Math::FrustumPlane
strong

Clip planes that form the camera frustum (visible area).

Enumerator
Left 
Right 
Top 
Bottom 
Far 
Near 

Function Documentation

◆ abs() [1/2]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::abs ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns the absolute value of a fixed-point value.

◆ abs() [2/2]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::abs ( LargeInteger< Hi, Low >  x)
constexpr

Returns the absolute value of x: |x|.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
xThe value whose absolute value is returned.
Returns
The absolute value of x.

◆ acos()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::acos ( FixedPoint< T, P >  x)
inlineconstexpr

Returns arccosine of a fixed-point value.

◆ angle() [1/2]

template<typename T >
T Math::angle ( const TVector2< T > &  v1,
const TVector2< T > &  v2 
)

◆ angle() [2/2]

template<typename T >
T Math::angle ( const TVector3< T > &  v1,
const TVector3< T > &  v2 
)

◆ approxEquals() [1/4]

template<typename T >
bool Math::approxEquals ( const TQuaternion< T > &  a,
const TQuaternion< T > &  b,
tolerance = std::numeric_limits<T>::epsilon() 
)
inline

Compare two quaternions, using tolerance for inaccuracies.

◆ approxEquals() [2/4]

template<typename T , glm::length_t D>
bool Math::approxEquals ( const TVector< D, T > &  a,
const TVector< D, T > &  b,
tolerance = std::numeric_limits<T>::epsilon() 
)
inline

Compare two vectors, using tolerance for inaccuracies.

◆ approxEquals() [3/4]

template<typename T , glm::length_t D>
bool Math::approxEquals ( const TVector< D, T > &  a,
b,
tolerance = std::numeric_limits<T>::epsilon() 
)
inline

Compare two vectors, using tolerance for inaccuracies.

◆ approxEquals() [4/4]

template<typename T >
bool Math::approxEquals ( a,
b,
tolerance = std::numeric_limits<T>::epsilon() 
)
inline

Compare two doubles, using tolerance for inaccuracies.

◆ asin()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::asin ( FixedPoint< T, P >  x)
inlineconstexpr

Returns arcsine of a fixed-point value.

◆ atan()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::atan ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns arctangent of a fixed-point value.

Returns the arctangent of x in the range of -pi/2 to pi/2 radians.

◆ atan2()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::atan2 ( const FixedPoint< T, P > &  y,
const FixedPoint< T, P > &  x 
)
inlineconstexpr

Returns arctangent of a fixed-point value.

Calculates the arctangent of y/x. atan2 is well defined for every point other than the origin, even if x equals 0 and y does not equal 0.

◆ bezier() [1/2]

template<int D, typename T >
TVector2< T > Math::bezier ( const TVector2< T >(&)  p[D],
t 
)

◆ bezier() [2/2]

template<int D, typename T >
TVector3< T > Math::bezier ( const TVector3< T >(&)  p[D],
t 
)

◆ bezier2()

template<int D0, int D1, typename T >
TVector3< T > Math::bezier2 ( const TVector3< T >(&)  p[D1][D0],
const TVector2< T > &  t 
)

◆ bezier2Jacobian()

template<int O, int D0, int D1, typename T >
TMatrix2x3< T > Math::bezier2Jacobian ( const TVector3< T >(&)  p[D1][D0],
const TVector2< T > &  t 
)

◆ bezierDerivative() [1/2]

template<int O, int D, typename T >
TVector2< T > Math::bezierDerivative ( const TVector2< T >(&)  p[D],
t 
)

◆ bezierDerivative() [2/2]

template<int O, int D, typename T >
TVector3< T > Math::bezierDerivative ( const TVector3< T >(&)  p[D],
t 
)

◆ ceil()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::ceil ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns smallest integer not less than a fixed-point value.

◆ cos()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::cos ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns cosine of a fixed-point value.

Returns the cosine of a in radians. The return value is in the range [-1,+1].

◆ cross()

template<typename T >
TVector2< T > Math::cross ( const TVector2< T > &  v)

◆ cubic()

template<typename T , typename U >
auto Math::cubic ( val1,
val2,
val3,
val4,
f 
)
inline

Performs cubic interpolation between two values bound between two other values where f is the alpha value.

It should range from 0.0 to 1.0. If it is 0.0 the method returns val2. If it is 1.0 it returns val3.

◆ cubicHermite()

template<class T >
T Math::cubicHermite ( const double  t,
const T &  pointA,
const T &  pointB,
const T &  tangentA,
const T &  tangentB 
)
inline

Evaluates a cubic Hermite curve at a specific point.

Parameters
tThe parameter that at which to evaluate the curve, in range [0, 1].
pointAThe starting point (at t=0).
pointBThe ending point (at t=1).
tangentAThe starting tangent (at t=0).
tangentBThe ending tangent (at t = 1).
Returns
The evaluated value at t.

◆ cubicHermiteCoefficients() [1/2]

template<class T >
Array< T, 4 > Math::cubicHermiteCoefficients ( const T &  pointA,
const T &  pointB,
const T &  tangentA,
const T &  tangentB 
)
inline

Calculates coefficients needed for evaluating a cubic curve in Hermite form.

Assumes t has been normalized is in range [0, 1]. Tangents must be scaled by the length of the curve (length is the maximum value of t before it was normalized).

Parameters
pointAThe starting point (at t=0).
pointBThe ending point (at t=1).
tangentAThe starting tangent (at t=0).
tangentBThe ending tangent (at t=1).
Returns
The four coefficients for the cubic curve, in order [t^3, t^2, t, 1].

◆ cubicHermiteCoefficients() [2/2]

template<class T , typename L >
Array< T, 4 > Math::cubicHermiteCoefficients ( const T &  pointA,
const T &  pointB,
const T &  tangentA,
const T &  tangentB,
length 
)
inline

Calculates coefficients needed for evaluating a cubic curve in Hermite form.

Assumes t is in range [0, length]. Tangents must not be scaled by length.

Parameters
pointAThe starting point (at t=0).
pointBThe ending point (at t=length).
tangentAThe starting tangent (at t=0).
tangentBThe ending tangent (at t=length).
lengthThe maximum value the curve will be evaluated at.
Returns
The four coefficients for the cubic curve, in order [t^3, t^2, t, 1].

◆ cubicHermiteD1()

template<class T >
T Math::cubicHermiteD1 ( const double  t,
const T &  pointA,
const T &  pointB,
const T &  tangentA,
const T &  tangentB 
)
inline

Evaluates the first derivative of a cubic Hermite curve at a specific point.

Parameters
tThe parameter that at which to evaluate the curve, in range [0, 1].
pointAThe starting point (at t=0).
pointBThe ending point (at t=1).
tangentAThe starting tangent (at t=0).
tangentBThe ending tangent (at t=1).
Returns
The evaluated value at t.

◆ flipProjectionY()

template<typename T >
TMatrix4< T > constexpr Math::flipProjectionY ( TMatrix4< T >  proj)
inlineconstexprnoexcept

◆ floor()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::floor ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns largest integer not greater than a fixed-point value.

◆ fmod()

template<typename B , unsigned int F>
constexpr FixedPoint< B, F > Math::fmod ( FixedPoint< B, F >  x,
FixedPoint< B, F >  y 
)
inlineconstexprnoexcept

◆ frac()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::frac ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns the fractional portion of a fixed-point value.

◆ frustum()

template<typename T >
constexpr TMatrix4< T > Math::frustum ( left,
right,
bottom,
top,
zNear,
zFar 
)
inlineconstexprnoexcept

Creates a frustum matrix with default handedness, using the default handedness and default near and far clip planes definition.

Template Parameters
TA floating-point scalar type
See also
glFrustum man page

◆ gaussianQuadrature()

template<typename T , typename Integrand >
T Math::gaussianQuadrature ( a,
b,
T *  roots,
T *  coefficients,
Integrand &&  integrand 
)
inline

Calculates the Gaussian Quadrature.

Parameters
aThe lower bound.
bThe upper bound.
rootsThe roots of the function.
coefficientsThe coefficients of the function.
integrandThe function to integrate.
Returns
The gaussian Quadrature integration.

◆ gcd()

template<typename A , typename B >
std::common_type_t< A, B > Math::gcd ( const A &  a,
const B &  b 
)
inline

Return the greater common divisor between two values.

◆ get() [1/2]

template<std::size_t N, glm::length_t D, typename T >
const T & Math::get ( const TVector< D, T > &  vector)
noexcept

Decomposes a vector into one of it's components.

Template Parameters
NThe component to be decomposed.
DThe vector dimension
TThe vector component type.
Parameters
vectorThe vector to be decomposed.
Returns
The decomposed vector component.

◆ get() [2/2]

template<std::size_t N, glm::length_t D, typename T >
T & Math::get ( TVector< D, T > &  vector)
noexcept

Decomposes a vector into one of it's components.

Template Parameters
NThe component to be decomposed.
DThe vector dimension
TThe vector component type.
Parameters
vectorThe vector to be decomposed.
Returns
The decomposed vector component.

◆ haltonSequence()

template<typename T >
T Math::haltonSequence ( int  index,
int  base 
)
inline

Generates numbers in a deterministic sequence suitable for Monte Carlo algorithms.

Parameters
indexThe index of the item in the sequence to return.
baseThe base that determines how is the sequence sub-divided.

◆ Height()

template<typename T >
constexpr T Math::Height ( const TRect2< T > &  rect)
inlineconstexpr

◆ infinitePerspective()

template<typename T >
constexpr TMatrix4< T > Math::infinitePerspective ( fovy,
aspect,
zNear 
)
inlineconstexprnoexcept

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness.

Parameters
fovySpecifies the field of view angle, in degrees, in the y direction. Expressed in radians.
aspectSpecifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
zNearSpecifies the distance from the viewer to the near clipping plane (always positive).
Template Parameters
TA floating-point scalar type

◆ invLerp()

template<typename T >
T Math::invLerp ( val,
min,
max 
)
inline

Determines the position of a value between two other values.

Returns 0 if value is less or equal than min, 1 if value is equal or greater than max, and value in range (0, 1) otherwise.

◆ lcm()

template<typename A , typename B >
std::common_type_t< A, B > Math::lcm ( const A &  a,
const B &  b 
)
inline

Return the least common multiple between two values.

◆ lerp()

template<typename T >
T Math::lerp ( t,
min,
max 
)
inline

Linearly interpolates between the two values using t.

t should be in [0, 1] range, where t = 0 corresponds to min value, while t = 1 corresponds to max value.

◆ MaxX()

template<typename T >
constexpr T Math::MaxX ( const TRect2< T > &  rect)
inlineconstexpr

◆ MaxY()

template<typename T >
constexpr T Math::MaxY ( const TRect2< T > &  rect)
inlineconstexpr

◆ MidX()

template<typename T >
constexpr T Math::MidX ( const TRect2< T > &  rect)
inlineconstexpr

◆ MidY()

template<typename T >
constexpr T Math::MidY ( const TRect2< T > &  rect)
inlineconstexpr

◆ MinX()

template<typename T >
constexpr T Math::MinX ( const TRect2< T > &  rect)
inlineconstexpr

◆ MinY()

template<typename T >
constexpr T Math::MinY ( const TRect2< T > &  rect)
inlineconstexpr

◆ mult128()

template<typename T >
constexpr void Math::mult128 ( N,
M,
T &  Ans 
)
constexpr

◆ mult128to256()

template<typename U >
constexpr void Math::mult128to256 ( N,
M,
U &  H,
U &  L 
)
constexpr

◆ multwide() [1/2]

template<typename T >
constexpr void Math::multwide ( LargeInteger< T, T >  a,
LargeInteger< T, T >  b,
LargeInteger< T, T > &  hi,
LargeInteger< T, T > &  lo 
)
constexpr

◆ multwide() [2/2]

template<typename T >
constexpr void Math::multwide ( a,
b,
T &  hi,
T &  lo 
)
constexpr

◆ nearZero()

template<typename T >
bool Math::nearZero ( a,
tolerance = T(1e-8) 
)
inline

Return true iff a is almost zero.

◆ normal()

template<typename T >
TVector3< T > Math::normal ( const TVector3< T > &  p1,
const TVector3< T > &  p2,
const TVector3< T > &  p3 
)

◆ operator!()

template<typename Hi , typename Low >
constexpr bool Math::operator! ( LargeInteger< Hi, Low >  lhs)
constexprnoexcept

Logically negates a large integer rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The logically negated large integer value

◆ operator!=() [1/7]

template<typename T , unsigned int P>
constexpr bool Math::operator!= ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers for inequality.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a and b DO NOT represent the same number

◆ operator!=() [2/7]

template<typename T >
constexpr bool Math::operator!= ( const TExtent2< T > &  lhs,
const TExtent2< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side extent 'lhs' is unequal to the right hand side extent 'rhs'.

◆ operator!=() [3/7]

template<typename T >
constexpr bool Math::operator!= ( const TExtent3< T > &  lhs,
const TExtent3< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side extent 'lhs' is unequal to the right hand side extent 'rhs'.

◆ operator!=() [4/7]

template<typename T >
constexpr bool Math::operator!= ( const TOffset2< T > &  lhs,
const TOffset2< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side offset 'lhs' is unequal to the right hand side offset 'rhs'.

◆ operator!=() [5/7]

template<typename T >
constexpr bool Math::operator!= ( const TOffset3< T > &  lhs,
const TOffset3< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side offset 'lhs' is unequal to the right hand side offset 'rhs'.

◆ operator!=() [6/7]

template<typename Hi , typename Low >
constexpr bool Math::operator!= ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Compares two large integer numbers lhs and rhs for inequality.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
true if lhs and rhs do not represent the same number

◆ operator!=() [7/7]

template<typename OffsetT , typename LengthT >
constexpr bool Math::operator!= ( TRange< OffsetT, LengthT >  a,
TRange< OffsetT, LengthT >  b 
)
constexprnoexcept

Compares two ranges for inequality.

Template Parameters
OffsetTthe range offset type
LengthTthe range length type
Parameters
aThe range a
bThe range b
Returns
true if both a and b DO NOT represent the same range.

◆ operator""_deg()

constexpr Degree Math::operator""_deg ( const long double  degree)
constexpr

Creates a new literal degree angle by using a user-defined literal.

◆ operator""_degf()

constexpr Degreef Math::operator""_degf ( const long double  degree)
constexpr

Creates a new literal degree angle by using a user-defined literal.

◆ operator""_fp()

constexpr FixedPoint< Int64, sizeof(Int64) *8 - std::numeric_limits< double >::digits > Math::operator""_fp ( const long double  v)
constexpr

Creates a new fixed-point number from an literal floating-point value.

Parameters
vThe floating point value
Returns
The fixed-point value that best represents the given floating-point value.

◆ operator""_rad()

constexpr Radian Math::operator""_rad ( const long double  radian)
constexpr

Creates a new literal radian angle by using a user-defined literal.

◆ operator""_radf()

constexpr Radianf Math::operator""_radf ( const long double  radian)
constexpr

Creates a new literal radian angle by using a user-defined literal.

◆ operator%()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator% ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Calculates the module two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The module result of lhs % rhs

◆ operator%=()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator%= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Calculates the remainder of the division of two large integer numbers lhs and rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator&() [1/2]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator& ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Bitwise and a large integer rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The bitwise and'ed large integer value

◆ operator&() [2/2]

template<typename OffsetT , typename LengthT >
constexpr TRange< OffsetT, LengthT > Math::operator& ( TRange< OffsetT, LengthT >  a,
TRange< OffsetT, LengthT >  b 
)
constexprnoexcept

Computes the intersection of both ranges a and b.

Template Parameters
OffsetTthe range offset type
LengthTthe range length type
Parameters
aThe range a
bThe range b
Returns
The range intersection

◆ operator&=()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator&= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Bitwise and a large integer rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator*() [1/3]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator* ( const FixedPoint< T, P >  x,
const typename FixedPoint< T, P >::Self  y 
)
inlineconstexprnoexcept

Multiply two fixed-point numbers a and b.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
xThe right-hand side operator
yThe left-hand side operator
Returns
The multiplication result of a * b

◆ operator*() [2/3]

template<typename T >
constexpr TExtent2< T > Math::operator* ( const TExtent2< T > &  lhs,
T &  rhs 
)
constexprnoexcept

Returns the multiplication of left hand side extent 'lhs' and the right hand side extent 'rhs'.

◆ operator*() [3/3]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator* ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Multiplies two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The multiplication result of lhs * rhs

◆ operator*=() [1/3]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & Math::operator*= ( FixedPoint< T, P > &  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Multiply two fixed-point numbers a and b and assigns the resulting value into a.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator

◆ operator*=() [2/3]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator*= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Multiply two large integer numbers lhs and rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator*=() [3/3]

template<typename T >
constexpr TExtent2< T > & Math::operator*= ( TExtent2< T > &  lhs,
rhs 
)
constexprnoexcept

Returns the multiplication of left hand side extent 'lhs' and the right hand side extent 'rhs'.

◆ operator+() [1/8]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator+ ( const FixedPoint< T, P >  a)
inlineconstexprnoexcept

Converts the fixed-point number a to it's negative representation.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe number to calculate the negative of
Returns
The negative representation of a

◆ operator+() [2/8]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator+ ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Add two fixed-point numbers a and b.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
The sum result of a + b

◆ operator+() [3/8]

template<typename T >
constexpr TExtent2< T > Math::operator+ ( const TExtent2< T > &  lhs,
const TExtent2< T > &  rhs 
)
constexprnoexcept

Returns the sum of left hand side extent 'lhs' and the right hand side extent 'rhs'.

Remarks
If the operation results in a numerical overflow, the respective components will be clamped to its maximum, i.e. std::numeric_limits<UInt32>::max().

◆ operator+() [4/8]

template<typename T >
constexpr TExtent3< T > Math::operator+ ( const TExtent3< T > &  lhs,
const TExtent3< T > &  rhs 
)
constexprnoexcept

Returns the sum of left hand side extent 'lhs' and the right hand side extent 'rhs'.

Remarks
If the operation results in a numerical overflow, the respective components will be clamped to its maximum, i.e. std::numeric_limits<UInt32>::max().

◆ operator+() [5/8]

template<typename T >
constexpr TOffset2< T > Math::operator+ ( const TOffset2< T > &  lhs,
const TOffset2< T > &  rhs 
)
constexprnoexcept

Returns the sum of left hand side offset 'lhs' and the right hand side offset 'rhs'.

Remarks
If the operation results in a numerical overflow or underflow, the respective components will be clamped into the range [std::numeric_limits<T>::min(), std::numeric_limits<T>::max().

◆ operator+() [6/8]

template<typename T >
constexpr TOffset3< T > Math::operator+ ( const TOffset3< T > &  lhs,
const TOffset3< T > &  rhs 
)
constexprnoexcept

Returns the sum of left hand side offset 'lhs' and the right hand side offset 'rhs'.

Remarks
If the operation results in a numerical overflow or underflow, the respective components will be clamped into the range std::numeric_limits<T>::min(), std::numeric_limits<T>::max().

◆ operator+() [7/8]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator+ ( LargeInteger< Hi, Low >  lhs)
constexprnoexcept
Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The rhs unmodified

◆ operator+() [8/8]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator+ ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Add two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The sum result of lhs + rhs

◆ operator++() [1/4]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & Math::operator++ ( FixedPoint< T, P > &  a)
inlineconstexprnoexcept

Increment the fixed-point value by adding 1.0 to it.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe fixed-point value to be incremented
Returns
a

◆ operator++() [2/4]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator++ ( FixedPoint< T, P > &  a,
int   
)
inlineconstexprnoexcept

Increment the fixed-point value by adding 1.0 to it.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe fixed-point value to be incremented
Returns
The value of a before the increment

◆ operator++() [3/4]

template<typename Hi , typename Low >
LargeInteger< Hi, Low > & Math::operator++ ( LargeInteger< Hi, Low > &  lhs)
noexcept

Increments a large integer lhs by 1.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The rhs integer incremented by one

◆ operator++() [4/4]

template<typename Hi , typename Low >
LargeInteger< Hi, Low > Math::operator++ ( LargeInteger< Hi, Low > &  lhs,
int   
)
noexcept

Increments a large integer lhs by 1.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The value of rhs before incrementing

◆ operator+=() [1/2]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & Math::operator+= ( FixedPoint< T, P > &  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Add two fixed-point numbers a and b and assigns the resulting value into a.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator

◆ operator+=() [2/2]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator+= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Add two large integer numbers lhs and rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator-() [1/8]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator- ( const FixedPoint< T, P >  a)
inlineconstexprnoexcept

Converts the fixed-point number a to it's negative representation.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe number to calculate the negative of
Returns
The negative representation of a

◆ operator-() [2/8]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator- ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Subtract two fixed-point numbers a and b.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
The subtraction result of a - b

◆ operator-() [3/8]

template<typename T >
constexpr TExtent2< T > Math::operator- ( const TExtent2< T > &  lhs,
const TExtent2< T > &  rhs 
)
constexprnoexcept

Returns the subtraction of left hand side extent 'lhs' and the right hand side extent 'rhs'.

Remarks
If the operation results in a numerical underflow, the respective components will be clamped to its minimum, i.e. 0.

◆ operator-() [4/8]

template<typename T >
constexpr TExtent3< T > Math::operator- ( const TExtent3< T > &  lhs,
const TExtent3< T > &  rhs 
)
constexprnoexcept

Returns the subtraction of left hand side extent 'lhs' and the right hand side extent 'rhs'.

Remarks
If the operation results in a numerical underflow, the respective components will be clamped to its minimum, i.e. 0.

◆ operator-() [5/8]

template<typename T >
constexpr TOffset2< T > Math::operator- ( const TOffset2< T > &  lhs,
const TOffset2< T > &  rhs 
)
constexprnoexcept

Returns the subtraction of left hand side offset 'lhs' and the right hand side offset 'rhs'.

Remarks
If the operation results in a numerical overflow or underflow, the respective components will be clamped into the range std::numeric_limits<T>::min(), std::numeric_limits<T>::max().

◆ operator-() [6/8]

template<typename T >
constexpr TOffset3< T > Math::operator- ( const TOffset3< T > &  lhs,
const TOffset3< T > &  rhs 
)
constexprnoexcept

Returns the subtraction of left hand side offset 'lhs' and the right hand side offset 'rhs'.

Remarks
If the operation results in a numerical overflow or underflow, the respective components will be clamped into the range std::numeric_limits<T>::min(), std::numeric_limits<T>::max().

◆ operator-() [7/8]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator- ( LargeInteger< Hi, Low >  lhs)
constexprnoexcept

Inverts the signal of a large integer rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The rhs integer with it's sign inverted

◆ operator-() [8/8]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator- ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Subtracts two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The subtraction result of lhs - rhs

◆ operator--() [1/4]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & Math::operator-- ( FixedPoint< T, P > &  a)
inlineconstexprnoexcept

Decrement the fixed-point value by subtracting 1.0 from it.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe fixed-point value to be decremented
Returns
a

◆ operator--() [2/4]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator-- ( FixedPoint< T, P > &  a,
int   
)
inlineconstexprnoexcept

Decrement the fixed-point value by subtracting 1.0 from it.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe fixed-point value to be decremented
Returns
The value of a before the decrement

◆ operator--() [3/4]

template<typename Hi , typename Low >
LargeInteger< Hi, Low > & Math::operator-- ( LargeInteger< Hi, Low > &  lhs)
noexcept

Decrements a large integer lhs by 1.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The rhs integer decremented by one

◆ operator--() [4/4]

template<typename Hi , typename Low >
LargeInteger< Hi, Low > Math::operator-- ( LargeInteger< Hi, Low > &  lhs,
int   
)
noexcept

Decrements a large integer lhs by 1.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The value of rhs before decrementing

◆ operator-=() [1/2]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > & Math::operator-= ( FixedPoint< T, P > &  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Subtract two fixed-point numbers a and b and assigns the resulting value into a.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator

◆ operator-=() [2/2]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator-= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Subtract two large integer numbers lhs and rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator/() [1/3]

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::operator/ ( const FixedPoint< T, P >  x,
const typename FixedPoint< T, P >::Self  y 
)
inlineconstexprnoexcept

Divide two fixed-point numbers a and b.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
xThe right-hand side operator
yThe left-hand side operator
Returns
The multiplication result of a / b

◆ operator/() [2/3]

template<typename T >
constexpr TExtent2< T > Math::operator/ ( const TExtent2< T > &  lhs,
T &  rhs 
)
constexprnoexcept

Returns the division of left hand side extent 'lhs' and the right hand side extent 'rhs'.

◆ operator/() [3/3]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator/ ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Divides two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The division result of lhs / rhs

◆ operator/=() [1/2]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator/= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Divide two large integer numbers lhs and rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator/=() [2/2]

template<typename T >
constexpr TExtent2< T > & Math::operator/= ( TExtent2< T > &  lhs,
rhs 
)
constexprnoexcept

Returns the division of left hand side extent 'lhs' and the right hand side extent 'rhs'.

◆ operator<() [1/4]

template<typename T , unsigned int P>
constexpr bool Math::operator< ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a smaller value than b.

◆ operator<() [2/4]

template<typename T , unsigned int P>
constexpr bool Math::operator< ( const FixedPoint< T, P >  a,
double  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a smaller value than b.

◆ operator<() [3/4]

template<typename OffsetT , typename LengthT >
constexpr bool Math::operator< ( decltype(TRange< OffsetT, LengthT >::offset)  offset,
TRange< OffsetT, LengthT >  range 
)
constexprnoexcept

Checks if a offset is before the range.

Template Parameters
OffsetTthe range offset type
LengthTthe range length type
Parameters
offsetThe offset to check against
rangeThe range a
Returns
true if offset comes before range.

◆ operator<() [4/4]

template<typename Hi , typename Low >
constexpr bool Math::operator< ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Compares two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
true if lhs has a smaller value than rhs

◆ operator<<() [1/12]

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator<< ( LargeInteger< Hi, Low >  lhs,
int  rhs 
)
constexprnoexcept

Left shifts rhs bits from lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The shifted integer value

◆ operator<<() [2/12]

template std::ostream & Math::operator<< ( std::ostream &  ,
const TRay< double > &   
)
extern

◆ operator<<() [3/12]

template std::ostream & Math::operator<< ( std::ostream &  ,
const TRay< float > &   
)
extern

◆ operator<<() [4/12]

template std::ostream & Math::operator<< ( std::ostream &  ,
const TRayIntersection< double > &   
)
extern

◆ operator<<() [5/12]

template std::ostream & Math::operator<< ( std::ostream &  ,
const TRayIntersection< float > &   
)
extern

◆ operator<<() [6/12]

template std::ostream & Math::operator<< ( std::ostream &  os,
const TAABox< double > &  box 
)
extern

◆ operator<<() [7/12]

template std::ostream & Math::operator<< ( std::ostream &  os,
const TAABox< float > &  box 
)
extern

◆ operator<<() [8/12]

template<typename T >
std::ostream & Math::operator<< ( std::ostream &  os,
const TAABox< T > &  box 
)

Prints a string representation of the AABox.

Parameters
osThe stream to print to
boxThe box to be printed
Returns
The given os.

◆ operator<<() [9/12]

template<CArithmetic T>
std::ostream & Math::operator<< ( std::ostream &  os,
const TDegree< T > &  deg 
)

◆ operator<<() [10/12]

template<CArithmetic T>
std::ostream & Math::operator<< ( std::ostream &  os,
const TRadian< T > &  rad 
)

◆ operator<<() [11/12]

template<typename T >
std::ostream & Math::operator<< ( std::ostream &  os,
const TRay< T > &  ray 
)

Prints a string representation of the Ray.

Parameters
osThe stream to print to
rayThe ray to be printed
Returns
The given os.

◆ operator<<() [12/12]

template<typename T >
std::ostream & Math::operator<< ( std::ostream &  os,
const TRayIntersection< T > &  intersection 
)

Prints a string representation of the RayIntersection.

Parameters
osThe stream to print to
intersectionThe ray intersection to be printed
Returns
The given os.

◆ operator<<=()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator<<= ( LargeInteger< Hi, Low > &  lhs,
int  rhs 
)
constexprnoexcept

Left shifts rhs bits from lhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator<=() [1/4]

template<typename T , unsigned int P>
constexpr bool Math::operator<= ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a smaller value than or is equal to b.

◆ operator<=() [2/4]

template<typename T , unsigned int P>
constexpr bool Math::operator<= ( const FixedPoint< T, P >  a,
double  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a smaller value than or is equal to b.

◆ operator<=() [3/4]

template<typename OffsetT , typename LengthT >
constexpr bool Math::operator<= ( decltype(TRange< OffsetT, LengthT >::offset)  offset,
TRange< OffsetT, LengthT >  range 
)
constexprnoexcept

Checks if a offset is before the range or is within the range.

Template Parameters
OffsetTthe range offset type
LengthTthe range length type
Parameters
offsetThe offset to check against
rangeThe range a
Returns
true if offset comes before range.

◆ operator<=() [4/4]

template<typename Hi , typename Low >
constexpr bool Math::operator<= ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Compares two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
true if lhs has a smaller value than or is equal to rhs

◆ operator==() [1/7]

template<typename T , unsigned int P>
constexpr bool Math::operator== ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers for equality.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a and b represents the same number

◆ operator==() [2/7]

template<typename T >
constexpr bool Math::operator== ( const TExtent2< T > &  lhs,
const TExtent2< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side extent 'lhs' is equal to the right hand side extent 'rhs'.

◆ operator==() [3/7]

template<typename T >
constexpr bool Math::operator== ( const TExtent3< T > &  lhs,
const TExtent3< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side extent 'lhs' is equal to the right hand side extent 'rhs'.

◆ operator==() [4/7]

template<typename T >
constexpr bool Math::operator== ( const TOffset2< T > &  lhs,
const TOffset2< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side offset 'lhs' is equal to the right hand side offset 'rhs'.

◆ operator==() [5/7]

template<typename T >
constexpr bool Math::operator== ( const TOffset3< T > &  lhs,
const TOffset3< T > &  rhs 
)
inlineconstexprnoexcept

Returns true if the left hand side offset 'lhs' is equal to the right hand side offset 'rhs'.

◆ operator==() [6/7]

template<typename Hi , typename Low >
constexpr bool Math::operator== ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Compares two large integer numbers lhs and rhs for equality.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
true if lhs and rhs represent the same number

◆ operator==() [7/7]

template<typename OffsetT , typename LengthT >
constexpr bool Math::operator== ( TRange< OffsetT, LengthT >  a,
TRange< OffsetT, LengthT >  b 
)
constexprnoexcept

Compares two ranges for equality.

Template Parameters
OffsetTthe range offset type
LengthTthe range length type
Parameters
aThe range a
bThe range b
Returns
true if both a and b represent the same range.

◆ operator>() [1/4]

template<typename T , unsigned int P>
constexpr bool Math::operator> ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a greater value than b.

◆ operator>() [2/4]

template<typename T , unsigned int P>
constexpr bool Math::operator> ( const FixedPoint< T, P >  a,
double  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a greater value than b.

◆ operator>() [3/4]

template<typename OffsetT , typename LengthT >
constexpr bool Math::operator> ( decltype(TRange< OffsetT, LengthT >::offset)  offset,
TRange< OffsetT, LengthT >  range 
)
constexprnoexcept

Checks if a offset is after the range.

Template Parameters
OffsetTthe range offset type
LengthTthe range length type
Parameters
offsetThe offset to check against
rangeThe range a
Returns
true if offset comes after range.

◆ operator>() [4/4]

template<typename Hi , typename Low >
constexpr bool Math::operator> ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Compares two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
true if lhs has a larger value than rhs

◆ operator>=() [1/4]

template<typename T , unsigned int P>
constexpr bool Math::operator>= ( const FixedPoint< T, P >  a,
const typename FixedPoint< T, P >::Self  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a greater value than or is equal to b.

◆ operator>=() [2/4]

template<typename T , unsigned int P>
constexpr bool Math::operator>= ( const FixedPoint< T, P >  a,
double  b 
)
inlineconstexprnoexcept

Compares two fixed-pointer numbers.

Template Parameters
Tthe fixed-point underlying integer type
Pthe number of bits dedicated to the fixed-point
Parameters
aThe right-hand side operator
bThe left-hand side operator
Returns
true if a has a greater value than or is equal to b.

◆ operator>=() [3/4]

template<typename OffsetT , typename LengthT >
constexpr bool Math::operator>= ( decltype(TRange< OffsetT, LengthT >::offset)  offset,
TRange< OffsetT, LengthT >  range 
)
constexprnoexcept

Checks if a offset is after the range or is within the range.

Template Parameters
OffsetTthe range offset type
LengthTthe range length type
Parameters
offsetThe offset to check against
rangeThe range a
Returns
true if offset comes after range.

◆ operator>=() [4/4]

template<typename Hi , typename Low >
constexpr bool Math::operator>= ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Compares two large integer numbers lhs and rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
true if lhs has a larger value than or is equal to rhs

◆ operator>>()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator>> ( LargeInteger< Hi, Low >  lhs,
int  rhs 
)
constexprnoexcept

Right shifts rhs bits from lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The shifted integer value

◆ operator>>=()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator>>= ( LargeInteger< Hi, Low > &  lhs,
int  rhs 
)
constexprnoexcept

Right shifts rhs bits from lhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator^()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator^ ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Bitwise xor a large integer rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The bitwise xor'ed large integer value

◆ operator^=()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator^= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Bitwise xor a large integer rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator|()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator| ( LargeInteger< Hi, Low >  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Bitwise or a large integer rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
The bitwise or'ed large integer value

◆ operator|=()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > & Math::operator|= ( LargeInteger< Hi, Low > &  lhs,
typename LargeInteger< Hi, Low >::Self  rhs 
)
constexprnoexcept

Bitwise or a large integer rhs in-place in lhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
rhsThe right-hand side operand
Returns
lhs after the operation

◆ operator~()

template<typename Hi , typename Low >
constexpr LargeInteger< Hi, Low > Math::operator~ ( LargeInteger< Hi, Low >  lhs)
constexprnoexcept

Bitwise negates a large integer rhs.

Template Parameters
Hithe large integer higher-order bits type
Lowthe large integer lower-order bits type
Parameters
lhsThe left-hand side operand
Returns
The bitwise negated large integer value

◆ ortho()

template<typename T >
constexpr TMatrix4< T > Math::ortho ( left,
right,
bottom,
top,
zNear,
zFar 
)
inlineconstexpr

Creates a matrix for projecting two-dimensional coordinates onto the screen.

Template Parameters
TA floating-point scalar type
See also
- glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar)
gluOrtho2D man page

◆ ortho2D()

template<typename T >
TMatrix4< T > Math::ortho2D ( const T &  left,
const T &  right,
const T &  bottom,
const T &  top 
)

◆ perspective()

template<typename T >
constexpr TMatrix4< T > Math::perspective ( fovy,
aspect,
zNear,
zFar 
)
inlineconstexprnoexcept

Creates a matrix for a symetric perspective-view frustum based on the default handedness and default near and far clip planes definition.

Parameters
fovySpecifies the field of view angle in the y direction. Expressed in radians.
aspectSpecifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
zNearSpecifies the distance from the viewer to the near clipping plane (always positive).
zFarSpecifies the distance from the viewer to the far clipping plane (always positive).
Template Parameters
TA floating-point scalar type
See also
gluPerspective man page

◆ perspectiveFov()

template<typename T >
constexpr TMatrix4< T > Math::perspectiveFov ( fov,
width,
height,
zNear,
zFar 
)
inlineconstexprnoexcept

Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition.

Parameters
fovExpressed in radians.
widthWidth of the viewport
heightHeight of the viewport
zNearSpecifies the distance from the viewer to the near clipping plane (always positive).
zFarSpecifies the distance from the viewer to the far clipping plane (always positive).
Template Parameters
TA floating-point scalar type

◆ project()

template<typename T , typename TI , typename TS >
TVector3< T > Math::project ( const TVector3< T > &  v,
const TMatrix4< T > &  modelViewProj,
const TVector2< TI > &  viewportOrigin,
const TVector2< TS > &  viewportSize 
)

◆ qrotate()

template<typename T >
TQuaternion< T > Math::qrotate ( const T &  angle,
const TVector3< T > &  axis 
)

◆ quintic()

template<typename T >
T Math::quintic ( val)
inline

Performs quintic interpolation where val is the value to map onto a quintic S-curve.

val should be in [0, 1] range.

◆ rombergIntegration()

template<typename T , typename Integrand >
T Math::rombergIntegration ( a,
b,
int  order,
Integrand &&  integrand 
)
inline

Calculates the Romberg Integration.

Parameters
aThe lower bound.
bThe upper bound.
orderThe order of the function.
integrandThe function to integrate.
Returns
The integrated function.

◆ rotate() [1/2]

template<typename T >
TMatrix3< T > Math::rotate ( const T &  angle)

◆ rotate() [2/2]

template<typename T >
TMatrix4< T > Math::rotate ( const TVector3< T > &  angle)

◆ round()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::round ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns the rounded value a fixed-point value.

The round operation returns the nearest integer to the operand.

◆ sign()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::sign ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns sign of scalar a fixed-point value.

1) Returns -1 component if the respective component of x is negative. 2) Returns 0 component if the respective component of x is zero. 3) Returns 1 component if the respective component of x is positive.

◆ sin()

template<typename B , unsigned int F>
FixedPoint< B, F > Math::sin ( FixedPoint< B, F >  x)
noexcept

◆ slerp()

template<typename T >
TVector3< T > Math::slerp ( const TVector3< T > &  v1,
const TVector3< T > &  v2,
const T &  a 
)

◆ smoothStep()

template<typename T >
double Math::smoothStep ( val1,
val2,
t 
)
inline

Performs smooth Hermite interpolation between values.

◆ solveCubic()

template<typename T >
int Math::solveCubic ( A,
B,
C,
D,
T *  roots 
)
inline

Solves the cubic equation with the parameters A, B, C, D.

Returns number of roots found and the roots themselves will be output in the roots array.

Parameters
AThe first variable.
BThe second variable.
CThe third variable.
DThe fourth variable.
rootsMust be at least size of 3.
Note
Only returns real roots.

◆ solveLinear()

template<typename T >
int Math::solveLinear ( A,
B,
T *  roots 
)
inline

Solves the linear equation with the parameters A, B.

Returns number of roots found and the roots themselves will be output in the roots array.

Parameters
AFirst variable.
BSecond variable.
rootsMust be at least size of 1.
Note
Only returns real roots.

◆ solveQuadratic()

template<typename T >
int Math::solveQuadratic ( A,
B,
C,
T *  roots 
)
inline

Solves the quadratic equation with the parameters A, B, C.

Returns number of roots found and the roots themselves will be output in the roots array.

Parameters
AThe first variable.
BThe second variable.
CThe third variable.
rootsMust be at least size of 2.
Note
Only returns real roots.

◆ solveQuartic()

template<typename T >
int Math::solveQuartic ( A,
B,
C,
D,
E,
T *  roots 
)
inline

Solves the quartic equation with the parameters A, B, C, D, E.

Parameters
AThe first variable.
BThe second variable.
CThe third variable.
DThe fourth variable.
EThe fifth variable.
rootsMust be at least size of 4.
Note
Only returns real roots.
Returns
The number of roots found and the roots themselves will be output in the roots array.

◆ sqrt()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::sqrt ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns square root of a fixed-point value.

◆ tan()

template<typename T , unsigned int P>
constexpr FixedPoint< T, P > Math::tan ( const FixedPoint< T, P > &  x)
inlineconstexpr

Returns tangent of a fixed-point value. Returns the tangent of a in radians.

◆ transform() [1/2]

template<typename T >
TVector2< T > Math::transform ( const TMatrix3< T > &  m,
const TVector2< T > &  v 
)

◆ transform() [2/2]

template<typename T >
TVector3< T > Math::transform ( const TQuaternion< T > &  q,
const TVector3< T > &  v 
)

◆ tweakedInfinitePerspective() [1/2]

template<typename T >
constexpr TMatrix4< T > Math::tweakedInfinitePerspective ( fovy,
aspect,
zNear 
)
inlineconstexprnoexcept

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.

Parameters
fovySpecifies the field of view angle, in degrees, in the y direction. Expressed in radians.
aspectSpecifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
zNearSpecifies the distance from the viewer to the near clipping plane (always positive).
Template Parameters
TA floating-point scalar type

◆ tweakedInfinitePerspective() [2/2]

template<typename T >
constexpr TMatrix4< T > Math::tweakedInfinitePerspective ( fovy,
aspect,
zNear,
ep 
)
inlineconstexprnoexcept

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.

Parameters
fovySpecifies the field of view angle, in degrees, in the y direction. Expressed in radians.
aspectSpecifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
zNearSpecifies the distance from the viewer to the near clipping plane (always positive).
epEpsilon
Template Parameters
TA floating-point scalar type

◆ Width()

template<typename T >
constexpr T Math::Width ( const TRect2< T > &  rect)
inlineconstexpr