clanCore Math

Classes

class  clan::Angle
 Angle class. More...
 
class  clan::AxisAlignedBoundingBox
 
class  clan::Base64Decoder
 Base64 decoder class. More...
 
class  clan::Base64Encoder
 Base64 encoder class. More...
 
class  clan::BezierCurve
 Bezier curve generator. More...
 
class  clan::BigInt
 Big Integer class. More...
 
class  clan::Circle
 Circle - Integer. More...
 
class  clan::Circled
 Circle - Double. More...
 
class  clan::Circlef
 Circle - Float. More...
 
class  clan::Circlex< Type >
 Circle. More...
 
class  clan::DelauneyTriangulator
 Delauney triangulator. More...
 
class  clan::DelauneyTriangulator_Triangle
 Triangle generated from a delauney triangulation. More...
 
class  clan::DelauneyTriangulator_Vertex
 Vertex in the delauney triangulation. More...
 
class  clan::EarClipResult
 Ear clipping triangulation result structure. More...
 
class  clan::EarClipTriangulator
 Ear-clipping triangulator. More...
 
class  clan::EarClipTriangulator_Triangle
 EarClipTriangulator_Triangle. More...
 
class  clan::HalfFloat
 
class  clan::IntersectionTest
 
class  clan::Line2
 2D line - Integer More...
 
class  clan::Line2d
 2D line - Double More...
 
class  clan::Line2f
 2D line - Float More...
 
class  clan::Line2x< Type >
 2D line More...
 
class  clan::Line3
 3D line - Integer More...
 
class  clan::Line3d
 3D line - Double More...
 
class  clan::Line3f
 3D line - Float More...
 
class  clan::Line3x< Type >
 3D line More...
 
class  clan::LineMath
 Math operations on 2D lines. More...
 
class  clan::LineRay2
 2D line ray - Integer More...
 
class  clan::LineRay2d
 2D line ray - Double More...
 
class  clan::LineRay2f
 2D line ray - Float More...
 
class  clan::LineRay2x< Type >
 2D line ray More...
 
class  clan::LineRay3
 3D line ray - Integer More...
 
class  clan::LineRay3d
 3D line ray - Double More...
 
class  clan::LineRay3f
 3D line ray - Float More...
 
class  clan::LineRay3x< Type >
 3D line ray More...
 
class  clan::LineSegment2
 2D line segment - Integer More...
 
class  clan::LineSegment2d
 2D line segment - Double More...
 
class  clan::LineSegment2f
 2D line segment - Float More...
 
class  clan::LineSegment2x< Type >
 2D line segment More...
 
class  clan::LineSegment3
 3D line segment - Integer More...
 
class  clan::LineSegment3d
 3D line segment - Double More...
 
class  clan::LineSegment3f
 3D line segment - Float More...
 
class  clan::LineSegment3x< Type >
 3D line segment More...
 
class  clan::Mat2< Type >
 2D matrix More...
 
class  clan::Mat3< Type >
 3D matrix More...
 
class  clan::Mat4< Type >
 4D matrix More...
 
class  clan::OrientedBoundingBox
 
class  clan::OutlineTriangulator
 Polygon Tesselator. More...
 
class  clan::Point
 2D (x,y) point structure - Integer More...
 
class  clan::Pointd
 2D (x,y) point structure - Double More...
 
class  clan::Pointf
 2D (x,y) point structure - Float More...
 
class  clan::PointSetMath
 Math operations related to point sets. More...
 
class  clan::Pointx< Type >
 2D (x,y) point structure. More...
 
class  clan::Quad
 2D quad structure - Integer More...
 
class  clan::Quadd
 2D quad structure - Double More...
 
class  clan::Quadf
 2D quad structure - Float More...
 
class  clan::Quadx< Type >
 2D quad structure. More...
 
class  clan::Quaterniond
 Quaternion - Double. More...
 
class  clan::Quaternionf
 Quaternion - Float. More...
 
class  clan::Quaternionx< Type >
 Quaternion. More...
 
class  clan::Rect
 2D (left,top,right,bottom) rectangle structure - Integer More...
 
class  clan::Rectd
 2D (left,top,right,bottom) rectangle structure - Double More...
 
class  clan::Rectf
 2D (left,top,right,bottom) rectangle structure - Float More...
 
class  clan::RectPacker
 Generic rect packer class. Implements an algorithm to pack rects into groups efficiently. More...
 
class  clan::Rectx< Type >
 2D (left,top,right,bottom) rectangle structure. More...
 
class  clan::Size
 2D (width,height) size structure - Integer More...
 
class  clan::Sized
 2D (width,height) size structure - Double More...
 
class  clan::Sizef
 2D (width,height) size structure - Float More...
 
class  clan::Sizex< Type >
 2D (width,height) size structure. More...
 
class  clan::Triangle
 Triangles - Integer. More...
 
class  clan::Triangled
 Triangles - Double. More...
 
class  clan::Trianglef
 Triangles - Float. More...
 
class  clan::Trianglex< Type >
 Triangles. More...
 
class  clan::Vec2< Type >
 2D vector More...
 
class  clan::Vec2hf
 2D half-float vector More...
 
class  clan::Vec3< Type >
 3D vector More...
 
class  clan::Vec3hf
 3D half-float vector More...
 
class  clan::Vec4< Type >
 4D vector More...
 
class  clan::Vec4hf
 4D half-float vector More...
 

Typedefs

typedef Mat2< double > clan::Mat2d
 
typedef Mat2< float > clan::Mat2f
 
typedef Mat2< int > clan::Mat2i
 
typedef Mat3< double > clan::Mat3d
 
typedef Mat3< float > clan::Mat3f
 
typedef Mat3< int > clan::Mat3i
 
typedef Mat4< double > clan::Mat4d
 
typedef Mat4< float > clan::Mat4f
 
typedef Mat4< int > clan::Mat4i
 
typedef Vec2< char > clan::Vec2b
 
typedef Vec2< double > clan::Vec2d
 
typedef Vec2< float > clan::Vec2f
 
typedef Vec2< int > clan::Vec2i
 
typedef Vec2< short > clan::Vec2s
 
typedef Vec2< unsigned char > clan::Vec2ub
 
typedef Vec2< unsigned int > clan::Vec2ui
 
typedef Vec2< unsigned short > clan::Vec2us
 
typedef Vec3< char > clan::Vec3b
 
typedef Vec3< double > clan::Vec3d
 
typedef Vec3< float > clan::Vec3f
 
typedef Vec3< int > clan::Vec3i
 
typedef Vec3< short > clan::Vec3s
 
typedef Vec3< unsigned char > clan::Vec3ub
 
typedef Vec3< unsigned int > clan::Vec3ui
 
typedef Vec3< unsigned short > clan::Vec3us
 
typedef Vec4< char > clan::Vec4b
 
typedef Vec4< double > clan::Vec4d
 
typedef Vec4< float > clan::Vec4f
 
typedef Vec4< int > clan::Vec4i
 
typedef Vec4< short > clan::Vec4s
 
typedef Vec4< unsigned char > clan::Vec4ub
 
typedef Vec4< unsigned int > clan::Vec4ui
 
typedef Vec4< unsigned short > clan::Vec4us
 

Enumerations

enum class  clan::AngleUnit { clan::AngleUnit::degrees , clan::AngleUnit::radians }
 Angle unit. More...
 
enum class  clan::ClipZRange { clan::ClipZRange::negative_positive_w , clan::ClipZRange::zero_positive_w }
 
enum class  clan::EulerOrder {
  clan::EulerOrder::XYZ , clan::EulerOrder::XZY , clan::EulerOrder::YZX , clan::EulerOrder::YXZ ,
  clan::EulerOrder::ZXY , clan::EulerOrder::ZYX
}
 Euler angle rotation order. More...
 
enum class  clan::Handedness { clan::Handedness::left , clan::Handedness::right }
 
enum class  clan::Origin {
  clan::Origin::top_left , clan::Origin::top_center , clan::Origin::top_right , clan::Origin::center_left ,
  clan::Origin::center , clan::Origin::center_right , clan::Origin::bottom_left , clan::Origin::bottom_center ,
  clan::Origin::bottom_right
}
 Alignment origins. More...
 
enum  clan::PolygonOrientation { clan::cl_clockwise , clan::cl_counter_clockwise }
 Polygon orientations. More...
 

Functions

 clan::Rectx< Type >::Rectx (const Rectx< double > &rect)
 Constructs an rectangle.
 
 clan::Rectx< Type >::Rectx (const Rectx< float > &rect)
 Constructs an rectangle.
 
 clan::Rectx< Type >::Rectx (const Rectx< int > &rect)
 Constructs an rectangle.
 
 clan::Vec2hf::Vec2hf (const Vec3hf &copy)
 
 clan::Vec2hf::Vec2hf (const Vec4hf &copy)
 
 clan::Vec3hf::Vec3hf (const Vec4hf &copy)
 
static Mat3< Type > clan::Mat3< Type >::add (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Add 2 matrices.
 
static Mat4< Type > clan::Mat4< Type >::add (const Mat4< Type > &matrix_1, const Mat4< Type > &matrix_2)
 Add 2 matrices.
 
static Mat3< Type > clan::Mat3< Type >::adjoint (const Mat3< Type > &matrix)
 Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.
 
static Mat4< Type > clan::Mat4< Type >::adjoint (const Mat4< Type > &matrix)
 Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.
 
template<typename A , typename B , typename C >
clan::clamp (A val, B minval, C maxval)
 
static Mat3< Type > clan::Mat3< Type >::identity ()
 
static Mat4< Type > clan::Mat4< Type >::identity ()
 Create the identity matrix.
 
static Mat3< Type > clan::Mat3< Type >::inverse (const Mat3< Type > &matrix)
 Calculate the matrix inverse of a matrix.
 
static Mat4< Type > clan::Mat4< Type >::inverse (const Mat4< Type > &matrix)
 Calculate the matrix inverse of a matrix.
 
Type clan::Vec2< Type >::length () const
 Returns the length (magnitude) of this vector.
 
Type clan::Vec3< Type >::length () const
 Returns the length (magnitude) of this vector.
 
Type clan::Vec4< Type >::length3 () const
 Returns the length (magnitude) of this vector (not taking into account the w ordinate).
 
Type clan::Vec4< Type >::length4 () const
 Returns the length (magnitude) of this vector (taking into account the w ordinate).
 
template<typename T , typename ... Args>
std::unique_ptr< T > clan::make_unique (Args &&...args)
 
template<typename A , typename B >
clan::max (A a, B b)
 
template<typename Type >
Vec2< Type > clan::max (Vec2< Type > a, Vec2< Type > b)
 
template<typename Type >
Vec3< Type > clan::max (Vec3< Type > a, Vec3< Type > b)
 
template<typename Type >
Vec4< Type > clan::max (Vec4< Type > a, Vec4< Type > b)
 
template<typename A , typename B >
clan::min (A a, B b)
 
template<typename Type >
Vec2< Type > clan::min (Vec2< Type > a, Vec2< Type > b)
 
template<typename Type >
Vec3< Type > clan::min (Vec3< Type > a, Vec3< Type > b)
 
template<typename Type >
Vec4< Type > clan::min (Vec4< Type > a, Vec4< Type > b)
 
template<typename A , typename B , typename C >
clan::mix (A a, B b, C mix)
 
static Mat3< Type > clan::Mat3< Type >::multiply (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Multiply 2 matrices.
 
static Mat4< Type > clan::Mat4< Type >::multiply (const Mat4< Type > &matrix_1, const Mat4< Type > &matrix_2)
 Multiply 2 matrices.
 
Vec2< Type > & clan::Vec2< Type >::normalize ()
 Normalizes this vector.
 
Vec3< Type > & clan::Vec3< Type >::normalize ()
 Normalizes this vector.
 
static Vec2< Type > clan::Vec2< Type >::normalize (const Vec2< Type > &vector)
 Normalizes a vector.
 
static Vec3< Type > clan::Vec3< Type >::normalize (const Vec3< Type > &vector)
 Normalizes a vector.
 
static Mat3< Type > clan::Mat3< Type >::null ()
 
static Mat4< Type > clan::Mat4< Type >::null ()
 Create a zero matrix.
 
template<typename Type >
Vec2< Type > clan::operator* (const Mat2< Type > &matrix, const Vec2< Type > &v)
 
template<typename Type >
Vec3< Type > clan::operator* (const Mat3< Type > &matrix, const Vec3< Type > &v)
 
template<typename Type >
Vec4< Type > clan::operator* (const Mat4< Type > &matrix, const Vec4< Type > &v)
 
template<typename Type >
Vec2< Type > clan::operator* (const Vec2< Type > &v, const Mat2< Type > &matrix)
 
template<typename Type >
Vec2< Type > clan::operator* (const Vec2< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator* (const Vec2< Type > &v1, const Vec2< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator* (const Vec3< Type > &v, const Mat3< Type > &matrix)
 
template<typename Type >
Vec3< Type > clan::operator* (const Vec3< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator* (const Vec3< Type > &v1, const Vec3< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator* (const Vec4< Type > &v, const Mat4< Type > &matrix)
 
template<typename Type >
Vec4< Type > clan::operator* (const Vec4< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator* (const Vec4< Type > &v1, const Vec4< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator* (Type s, const Vec2< Type > &v)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator* (Type s, const Vec3< Type > &v)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator* (Type s, const Vec4< Type > &v)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator+ (const Vec2< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator+ (const Vec2< Type > &v1, const Vec2< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator+ (const Vec3< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator+ (const Vec3< Type > &v1, const Vec3< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator+ (const Vec4< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator+ (const Vec4< Type > &v1, const Vec4< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator+ (Type s, const Vec2< Type > &v)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator+ (Type s, const Vec3< Type > &v)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator+ (Type s, const Vec4< Type > &v)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator- (const Vec2< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator- (const Vec2< Type > &v1, const Vec2< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator- (const Vec3< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator- (const Vec3< Type > &v1, const Vec3< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator- (const Vec4< Type > &v, Type s)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator- (const Vec4< Type > &v1, const Vec4< Type > &v2)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator- (Type s, const Vec2< Type > &v)
 
  • operator.

 
template<typename Type >
Vec3< Type > clan::operator- (Type s, const Vec3< Type > &v)
 
  • operator.

 
template<typename Type >
Vec4< Type > clan::operator- (Type s, const Vec4< Type > &v)
 
  • operator.

 
template<typename Type >
Vec2< Type > clan::operator/ (const Vec2< Type > &v, Type s)
 / operator.
 
template<typename Type >
Vec2< Type > clan::operator/ (const Vec2< Type > &v1, const Vec2< Type > &v2)
 / operator.
 
template<typename Type >
Vec3< Type > clan::operator/ (const Vec3< Type > &v, Type s)
 / operator.
 
template<typename Type >
Vec3< Type > clan::operator/ (const Vec3< Type > &v1, const Vec3< Type > &v2)
 / operator.
 
template<typename Type >
Vec4< Type > clan::operator/ (const Vec4< Type > &v, Type s)
 / operator.
 
template<typename Type >
Vec4< Type > clan::operator/ (const Vec4< Type > &v1, const Vec4< Type > &v2)
 / operator.
 
template<typename Type >
Vec2< Type > clan::operator/ (Type s, const Vec2< Type > &v)
 / operator.
 
template<typename Type >
Vec3< Type > clan::operator/ (Type s, const Vec3< Type > &v)
 / operator.
 
template<typename Type >
Vec4< Type > clan::operator/ (Type s, const Vec4< Type > &v)
 / operator.
 
template<typename T >
clan::pow2 (T value)
 
Rectd clan::RectdPS (double x, double y, double width, double height)
 
Rectf clan::RectfPS (float x, float y, float width, float height)
 
Rect clan::RectPS (int x, int y, int width, int height)
 
template<typename Type >
Vec2< Type > clan::sign (const Vec2< Type > &x)
 
template<typename Type >
Vec3< Type > clan::sign (const Vec3< Type > &x)
 
template<typename Type >
Vec4< Type > clan::sign (const Vec4< Type > &x)
 
double clan::sign (double x)
 
float clan::sign (float x)
 
int clan::sign (int x)
 
template<typename A , typename B , typename C >
clan::smoothstep (A edge0, B edge1, C x)
 
template<typename Type >
Vec2< Type > clan::step (const Vec2< Type > &edge, const Vec2< Type > &x)
 
template<typename Type >
Vec3< Type > clan::step (const Vec3< Type > &edge, const Vec3< Type > &x)
 
template<typename Type >
Vec4< Type > clan::step (const Vec4< Type > &edge, const Vec4< Type > &x)
 
double clan::step (double edge, double x)
 
float clan::step (float edge, float x)
 
int clan::step (int edge, int x)
 
long long clan::step (long long edge, long long x)
 
static Mat3< Type > clan::Mat3< Type >::subtract (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Subtract 2 matrices.
 
static Mat4< Type > clan::Mat4< Type >::subtract (const Mat4< Type > &matrix_1, const Mat4< Type > &matrix_2)
 Subtract 2 matrices.
 
static Mat3< Type > clan::Mat3< Type >::transpose (const Mat3< Type > &matrix)
 Calculate the transpose of a matrix.
 
static Mat4< Type > clan::Mat4< Type >::transpose (const Mat4< Type > &matrix)
 Calculate the transpose of a matrix.
 

Detailed Description

Typedef Documentation

◆ Mat2d

typedef Mat2<double> clan::Mat2d

◆ Mat2f

typedef Mat2<float> clan::Mat2f

◆ Mat2i

typedef Mat2<int> clan::Mat2i

◆ Mat3d

typedef Mat3<double> clan::Mat3d

◆ Mat3f

typedef Mat3<float> clan::Mat3f

◆ Mat3i

typedef Mat3<int> clan::Mat3i

◆ Mat4d

typedef Mat4<double> clan::Mat4d

◆ Mat4f

typedef Mat4<float> clan::Mat4f

◆ Mat4i

typedef Mat4<int> clan::Mat4i

◆ Vec2b

typedef Vec2<char> clan::Vec2b

◆ Vec2d

typedef Vec2<double> clan::Vec2d

◆ Vec2f

typedef Vec2<float> clan::Vec2f

◆ Vec2i

typedef Vec2<int> clan::Vec2i

◆ Vec2s

typedef Vec2<short> clan::Vec2s

◆ Vec2ub

typedef Vec2<unsigned char> clan::Vec2ub

◆ Vec2ui

typedef Vec2<unsigned int> clan::Vec2ui

◆ Vec2us

typedef Vec2<unsigned short> clan::Vec2us

◆ Vec3b

typedef Vec3<char> clan::Vec3b

◆ Vec3d

typedef Vec3<double> clan::Vec3d

◆ Vec3f

typedef Vec3<float> clan::Vec3f

◆ Vec3i

typedef Vec3<int> clan::Vec3i

◆ Vec3s

typedef Vec3<short> clan::Vec3s

◆ Vec3ub

typedef Vec3<unsigned char> clan::Vec3ub

◆ Vec3ui

typedef Vec3<unsigned int> clan::Vec3ui

◆ Vec3us

typedef Vec3<unsigned short> clan::Vec3us

◆ Vec4b

typedef Vec4<char> clan::Vec4b

◆ Vec4d

typedef Vec4<double> clan::Vec4d

◆ Vec4f

typedef Vec4<float> clan::Vec4f

◆ Vec4i

typedef Vec4<int> clan::Vec4i

◆ Vec4s

typedef Vec4<short> clan::Vec4s

◆ Vec4ub

typedef Vec4<unsigned char> clan::Vec4ub

◆ Vec4ui

typedef Vec4<unsigned int> clan::Vec4ui

◆ Vec4us

typedef Vec4<unsigned short> clan::Vec4us

Enumeration Type Documentation

◆ AngleUnit

enum class clan::AngleUnit
strong

Angle unit.

Enumerator
degrees 
radians 

◆ ClipZRange

enum class clan::ClipZRange
strong
Enumerator
negative_positive_w 
zero_positive_w 

◆ EulerOrder

enum class clan::EulerOrder
strong

Euler angle rotation order.

Enumerator
XYZ 
XZY 
YZX 
YXZ 
ZXY 
ZYX 

◆ Handedness

enum class clan::Handedness
strong
Enumerator
left 
right 

◆ Origin

enum class clan::Origin
strong

Alignment origins.

Enumerator
top_left 
top_center 
top_right 
center_left 
center 
center_right 
bottom_left 
bottom_center 
bottom_right 

◆ PolygonOrientation

Polygon orientations.

Enumerator
cl_clockwise 
cl_counter_clockwise 

Function Documentation

◆ Rectx() [1/3]

template<typename Type >
clan::Rectx< Type >::Rectx ( const Rectx< double > &  rect)
inline

Constructs an rectangle.

Parameters
rectInitial rectangle position and size.

◆ Rectx() [2/3]

template<typename Type >
clan::Rectx< Type >::Rectx ( const Rectx< float > &  rect)
inline

Constructs an rectangle.

Parameters
rectInitial rectangle position and size.

◆ Rectx() [3/3]

template<typename Type >
clan::Rectx< Type >::Rectx ( const Rectx< int > &  rect)
inline

Constructs an rectangle.

Parameters
rectInitial rectangle position and size.

◆ Vec2hf() [1/2]

clan::Vec2hf::Vec2hf ( const Vec3hf copy)
inlineexplicit

◆ Vec2hf() [2/2]

clan::Vec2hf::Vec2hf ( const Vec4hf copy)
inlineexplicit

◆ Vec3hf()

clan::Vec3hf::Vec3hf ( const Vec4hf copy)
inlineexplicit

◆ add() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::add ( const Mat3< Type > &  matrix_1,
const Mat3< Type > &  matrix_2 
)
inlinestatic

Add 2 matrices.

This adds the matrix as follows: result = matrix1 + matrix2

Parameters
matrix_1= First Matrix to add
matrix_2= Second Matrix to add
Returns
The matrix

◆ add() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::add ( const Mat4< Type > &  matrix_1,
const Mat4< Type > &  matrix_2 
)
inlinestatic

Add 2 matrices.

This adds the matrix as follows: result = matrix1 + matrix2

Parameters
matrix_1= First Matrix to add
matrix_2= Second Matrix to add
Returns
The matrix

◆ adjoint() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::adjoint ( const Mat3< Type > &  matrix)
inlinestatic

Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.

Parameters
matrix= The matrix to use
Returns
The adjoint matrix

References clan::Mat3< Type >::adjoint().

Referenced by clan::Mat3< Type >::adjoint().

◆ adjoint() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::adjoint ( const Mat4< Type > &  matrix)
inlinestatic

Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.

Parameters
matrix= The matrix to use
Returns
The adjoint matrix

References clan::Mat4< Type >::adjoint().

Referenced by clan::Mat4< Type >::adjoint().

◆ clamp()

template<typename A , typename B , typename C >
C clan::clamp ( val,
minval,
maxval 
)
inline

References clan::max, and clan::min.

◆ identity() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::identity
inlinestatic

References clan::m, and clan::null.

◆ identity() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::identity
inlinestatic

Create the identity matrix.

Returns
The matrix

References clan::m, and clan::null.

◆ inverse() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::inverse ( const Mat3< Type > &  matrix)
inlinestatic

Calculate the matrix inverse of a matrix.

Creates a zero matrix if the determinent == 0

Parameters
matrix= The matrix to use
Returns
The inversed matrix

References clan::Mat3< Type >::inverse().

Referenced by clan::Mat3< Type >::inverse().

◆ inverse() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::inverse ( const Mat4< Type > &  matrix)
inlinestatic

Calculate the matrix inverse of a matrix.

Creates a zero matrix if the determinent == 0

Parameters
matrix= The matrix to use
Returns
The inversed matrix

References clan::Mat4< Type >::inverse().

Referenced by clan::Mat4< Type >::inverse().

◆ length() [1/2]

template<typename Type >
Type clan::Vec2< Type >::length
inline

Returns the length (magnitude) of this vector.

Operates in the native datatype

Returns
the length of the vector

References clan::x, and clan::y.

◆ length() [2/2]

template<typename Type >
Type clan::Vec3< Type >::length
inline

Returns the length (magnitude) of this vector.

Operates in the native datatype

Returns
the length of the vector

References clan::x, clan::y, and clan::z.

◆ length3()

template<typename Type >
Type clan::Vec4< Type >::length3
inline

Returns the length (magnitude) of this vector (not taking into account the w ordinate).

Operates in the native datatype

Returns
the length of the vector *‍/

References clan::x, clan::y, and clan::z.

◆ length4()

template<typename Type >
Type clan::Vec4< Type >::length4
inline

Returns the length (magnitude) of this vector (taking into account the w ordinate).

Operates in the native datatype

Returns
the length of the vector *‍/

References clan::w, clan::x, clan::y, and clan::z.

◆ make_unique()

template<typename T , typename ... Args>
std::unique_ptr< T > clan::make_unique ( Args &&...  args)

◆ max() [1/4]

template<typename A , typename B >
A clan::max ( a,
b 
)
inline

References clan::a, and clan::b.

◆ max() [2/4]

template<typename Type >
Vec2< Type > clan::max ( Vec2< Type >  a,
Vec2< Type >  b 
)
inline

References clan::a, clan::b, and clan::max.

◆ max() [3/4]

template<typename Type >
Vec3< Type > clan::max ( Vec3< Type >  a,
Vec3< Type >  b 
)
inline

References clan::a, clan::b, and clan::max.

◆ max() [4/4]

template<typename Type >
Vec4< Type > clan::max ( Vec4< Type >  a,
Vec4< Type >  b 
)
inline

References clan::a, clan::b, and clan::max.

◆ min() [1/4]

template<typename A , typename B >
A clan::min ( a,
b 
)
inline

References clan::a, and clan::b.

◆ min() [2/4]

template<typename Type >
Vec2< Type > clan::min ( Vec2< Type >  a,
Vec2< Type >  b 
)
inline

References clan::a, clan::b, and clan::min.

◆ min() [3/4]

template<typename Type >
Vec3< Type > clan::min ( Vec3< Type >  a,
Vec3< Type >  b 
)
inline

References clan::a, clan::b, and clan::min.

◆ min() [4/4]

template<typename Type >
Vec4< Type > clan::min ( Vec4< Type >  a,
Vec4< Type >  b 
)
inline

References clan::a, clan::b, and clan::min.

◆ mix()

template<typename A , typename B , typename C >
A clan::mix ( a,
b,
mix 
)
inline

References clan::a, clan::b, and clan::mix().

Referenced by clan::mix().

◆ multiply() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::multiply ( const Mat3< Type > &  matrix_1,
const Mat3< Type > &  matrix_2 
)
inlinestatic

Multiply 2 matrices.

This multiplies the matrix as follows: result = matrix1 * matrix2
Matrix is multiplied in the Column-Major matrix format (opengl native)

Parameters
matrix_1= First Matrix to multiply
matrix_2= Second Matrix to multiply
Returns
The matrix

◆ multiply() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::multiply ( const Mat4< Type > &  matrix_1,
const Mat4< Type > &  matrix_2 
)
inlinestatic

Multiply 2 matrices.

This multiplies the matrix as follows: result = matrix1 * matrix2
Matrix is multiplied in the Column-Major matrix format (opengl native)

Parameters
matrix_1= First Matrix to multiply
matrix_2= Second Matrix to multiply
Returns
The matrix

◆ normalize() [1/4]

template<typename Type >
Vec2< Type > & clan::Vec2< Type >::normalize
inline

Normalizes this vector.

Operates in the native datatype

Returns
reference to this object

References clan::f, clan::length, clan::x, and clan::y.

◆ normalize() [2/4]

template<typename Type >
Vec3< Type > & clan::Vec3< Type >::normalize
inline

Normalizes this vector.

Operates in the native datatype

Returns
reference to this object

References clan::f, clan::length, clan::x, clan::y, and clan::z.

◆ normalize() [3/4]

template<typename Type >
Vec2< Type > clan::Vec2< Type >::normalize ( const Vec2< Type > &  vector)
inlinestatic

Normalizes a vector.

Operates in the native datatype

Parameters
vector= Vector to use
Returns
normalized vector

References clan::Vec2< Type >::normalize().

Referenced by clan::Vec2< Type >::normalize().

◆ normalize() [4/4]

template<typename Type >
Vec3< Type > clan::Vec3< Type >::normalize ( const Vec3< Type > &  vector)
inlinestatic

Normalizes a vector.

Parameters
vector= Vector to use

Operates in the native datatype

References clan::Vec3< Type >::normalize().

Referenced by clan::Vec3< Type >::normalize().

◆ null() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::null
inlinestatic

References clan::m.

◆ null() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::null
inlinestatic

Create a zero matrix.

Returns
The matrix

References clan::m.

◆ operator*() [1/15]

template<typename Type >
Vec2< Type > clan::operator* ( const Mat2< Type > &  matrix,
const Vec2< Type > &  v 
)

References clan::v.

◆ operator*() [2/15]

template<typename Type >
Vec3< Type > clan::operator* ( const Mat3< Type > &  matrix,
const Vec3< Type > &  v 
)

Matrix is assumed to be in the Column-Major matrix format (opengl native)
Note: "vec = vector * matrix" is different to "vec = matrix * vector"

References clan::v.

◆ operator*() [3/15]

template<typename Type >
Vec4< Type > clan::operator* ( const Mat4< Type > &  matrix,
const Vec4< Type > &  v 
)

References clan::v.

◆ operator*() [4/15]

template<typename Type >
Vec2< Type > clan::operator* ( const Vec2< Type > &  v,
const Mat2< Type > &  matrix 
)

References clan::v.

◆ operator*() [5/15]

template<typename Type >
Vec2< Type > clan::operator* ( const Vec2< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator*() [6/15]

template<typename Type >
Vec2< Type > clan::operator* ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

  • operator.

References clan::Vec2< Type >::x, and clan::Vec2< Type >::y.

◆ operator*() [7/15]

template<typename Type >
Vec3< Type > clan::operator* ( const Vec3< Type > &  v,
const Mat3< Type > &  matrix 
)

Matrix is assumed to be in the Column-Major matrix format (opengl native)
Note: "vec = vector * matrix" is different to "vec = matrix * vector"

References clan::v.

◆ operator*() [8/15]

template<typename Type >
Vec3< Type > clan::operator* ( const Vec3< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator*() [9/15]

template<typename Type >
Vec3< Type > clan::operator* ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

◆ operator*() [10/15]

template<typename Type >
Vec4< Type > clan::operator* ( const Vec4< Type > &  v,
const Mat4< Type > &  matrix 
)

References clan::v.

◆ operator*() [11/15]

template<typename Type >
Vec4< Type > clan::operator* ( const Vec4< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator*() [12/15]

template<typename Type >
Vec4< Type > clan::operator* ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

◆ operator*() [13/15]

template<typename Type >
Vec2< Type > clan::operator* ( Type  s,
const Vec2< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator*() [14/15]

template<typename Type >
Vec3< Type > clan::operator* ( Type  s,
const Vec3< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator*() [15/15]

template<typename Type >
Vec4< Type > clan::operator* ( Type  s,
const Vec4< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator+() [1/9]

template<typename Type >
Vec2< Type > clan::operator+ ( const Vec2< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator+() [2/9]

template<typename Type >
Vec2< Type > clan::operator+ ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

  • operator.

References clan::Vec2< Type >::x, and clan::Vec2< Type >::y.

◆ operator+() [3/9]

template<typename Type >
Vec3< Type > clan::operator+ ( const Vec3< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator+() [4/9]

template<typename Type >
Vec3< Type > clan::operator+ ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

◆ operator+() [5/9]

template<typename Type >
Vec4< Type > clan::operator+ ( const Vec4< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator+() [6/9]

template<typename Type >
Vec4< Type > clan::operator+ ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

◆ operator+() [7/9]

template<typename Type >
Vec2< Type > clan::operator+ ( Type  s,
const Vec2< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator+() [8/9]

template<typename Type >
Vec3< Type > clan::operator+ ( Type  s,
const Vec3< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator+() [9/9]

template<typename Type >
Vec4< Type > clan::operator+ ( Type  s,
const Vec4< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator-() [1/9]

template<typename Type >
Vec2< Type > clan::operator- ( const Vec2< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator-() [2/9]

template<typename Type >
Vec2< Type > clan::operator- ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

  • operator.

References clan::Vec2< Type >::x, and clan::Vec2< Type >::y.

◆ operator-() [3/9]

template<typename Type >
Vec3< Type > clan::operator- ( const Vec3< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator-() [4/9]

template<typename Type >
Vec3< Type > clan::operator- ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

◆ operator-() [5/9]

template<typename Type >
Vec4< Type > clan::operator- ( const Vec4< Type > &  v,
Type  s 
)

  • operator.

References clan::s, and clan::v.

◆ operator-() [6/9]

template<typename Type >
Vec4< Type > clan::operator- ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

◆ operator-() [7/9]

template<typename Type >
Vec2< Type > clan::operator- ( Type  s,
const Vec2< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator-() [8/9]

template<typename Type >
Vec3< Type > clan::operator- ( Type  s,
const Vec3< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator-() [9/9]

template<typename Type >
Vec4< Type > clan::operator- ( Type  s,
const Vec4< Type > &  v 
)

  • operator.

References clan::s, and clan::v.

◆ operator/() [1/9]

template<typename Type >
Vec2< Type > clan::operator/ ( const Vec2< Type > &  v,
Type  s 
)

/ operator.

References clan::s, and clan::v.

◆ operator/() [2/9]

template<typename Type >
Vec2< Type > clan::operator/ ( const Vec2< Type > &  v1,
const Vec2< Type > &  v2 
)

/ operator.

References clan::Vec2< Type >::x, and clan::Vec2< Type >::y.

◆ operator/() [3/9]

template<typename Type >
Vec3< Type > clan::operator/ ( const Vec3< Type > &  v,
Type  s 
)

/ operator.

References clan::s, and clan::v.

◆ operator/() [4/9]

template<typename Type >
Vec3< Type > clan::operator/ ( const Vec3< Type > &  v1,
const Vec3< Type > &  v2 
)

◆ operator/() [5/9]

template<typename Type >
Vec4< Type > clan::operator/ ( const Vec4< Type > &  v,
Type  s 
)

/ operator.

References clan::s, and clan::v.

◆ operator/() [6/9]

template<typename Type >
Vec4< Type > clan::operator/ ( const Vec4< Type > &  v1,
const Vec4< Type > &  v2 
)

◆ operator/() [7/9]

template<typename Type >
Vec2< Type > clan::operator/ ( Type  s,
const Vec2< Type > &  v 
)

/ operator.

References clan::s, and clan::v.

◆ operator/() [8/9]

template<typename Type >
Vec3< Type > clan::operator/ ( Type  s,
const Vec3< Type > &  v 
)

/ operator.

References clan::s, and clan::v.

◆ operator/() [9/9]

template<typename Type >
Vec4< Type > clan::operator/ ( Type  s,
const Vec4< Type > &  v 
)

/ operator.

References clan::s, and clan::v.

◆ pow2()

template<typename T >
T clan::pow2 ( value)
inline

◆ RectdPS()

Rectd clan::RectdPS ( double  x,
double  y,
double  width,
double  height 
)
inline

References clan::x, and clan::y.

◆ RectfPS()

Rectf clan::RectfPS ( float  x,
float  y,
float  width,
float  height 
)
inline

References clan::x, and clan::y.

◆ RectPS()

Rect clan::RectPS ( int  x,
int  y,
int  width,
int  height 
)
inline

References clan::x, and clan::y.

◆ sign() [1/6]

template<typename Type >
Vec2< Type > clan::sign ( const Vec2< Type > &  x)
inline

References clan::sign(), and clan::x.

◆ sign() [2/6]

template<typename Type >
Vec3< Type > clan::sign ( const Vec3< Type > &  x)
inline

References clan::sign(), and clan::x.

◆ sign() [3/6]

template<typename Type >
Vec4< Type > clan::sign ( const Vec4< Type > &  x)
inline

References clan::sign(), and clan::x.

◆ sign() [4/6]

double clan::sign ( double  x)
inline

References clan::x.

◆ sign() [5/6]

float clan::sign ( float  x)
inline

References clan::x.

◆ sign() [6/6]

int clan::sign ( int  x)
inline

References clan::x.

Referenced by clan::sign().

◆ smoothstep()

template<typename A , typename B , typename C >
C clan::smoothstep ( edge0,
edge1,
x 
)
inline

References clan::clamp, clan::t, and clan::x.

◆ step() [1/7]

template<typename Type >
Vec2< Type > clan::step ( const Vec2< Type > &  edge,
const Vec2< Type > &  x 
)
inline

◆ step() [2/7]

template<typename Type >
Vec3< Type > clan::step ( const Vec3< Type > &  edge,
const Vec3< Type > &  x 
)
inline

◆ step() [3/7]

template<typename Type >
Vec4< Type > clan::step ( const Vec4< Type > &  edge,
const Vec4< Type > &  x 
)
inline

◆ step() [4/7]

double clan::step ( double  edge,
double  x 
)
inline

References clan::x.

◆ step() [5/7]

float clan::step ( float  edge,
float  x 
)
inline

References clan::x.

◆ step() [6/7]

int clan::step ( int  edge,
int  x 
)
inline

References clan::x.

Referenced by clan::step().

◆ step() [7/7]

long long clan::step ( long long  edge,
long long  x 
)
inline

References clan::x.

◆ subtract() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::subtract ( const Mat3< Type > &  matrix_1,
const Mat3< Type > &  matrix_2 
)
inlinestatic

Subtract 2 matrices.

This subtracts the matrix as follows: result = matrix1 - matrix2

Parameters
matrix_1= First Matrix to subtract
matrix_2= Second Matrix to subtract
Returns
The matrix

◆ subtract() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::subtract ( const Mat4< Type > &  matrix_1,
const Mat4< Type > &  matrix_2 
)
inlinestatic

Subtract 2 matrices.

This subtracts the matrix as follows: result = matrix1 - matrix2

Parameters
matrix_1= First Matrix to subtract
matrix_2= Second Matrix to subtract
Returns
The matrix

◆ transpose() [1/2]

template<typename Type >
Mat3< Type > clan::Mat3< Type >::transpose ( const Mat3< Type > &  matrix)
inlinestatic

Calculate the transpose of a matrix.

Parameters
matrix= The matrix to use
Returns
The transposed matrix

References clan::Mat3< Type >::transpose().

Referenced by clan::Mat3< Type >::transpose().

◆ transpose() [2/2]

template<typename Type >
Mat4< Type > clan::Mat4< Type >::transpose ( const Mat4< Type > &  matrix)
inlinestatic

Calculate the transpose of a matrix.

Parameters
matrix= The matrix to use
Returns
The transposed matrix

References clan::Mat4< Type >::transpose().

Referenced by clan::Mat4< Type >::transpose().