Rasterfarm-SDK
Loading...
Searching...
No Matches
vector.h File Reference
#include <string.h>
#include "utils.h"
#include "error.h"

Classes

class  Vector< T, LENGTH >
 
class  VectorArray< C >
 

Typedefs

using Vector2d = Vector< double, 2 >
 
using Vector2f = Vector< float, 2 >
 
using Vector2s = Vector< short, 2 >
 
using Vector2i = Vector< int, 2 >
 
using Vector2u = Vector< uint, 2 >
 
using Vector2b = Vector< Byte, 2 >
 
using Vector3d = Vector< double, 3 >
 
using Vector3f = Vector< float, 3 >
 
using Vector3s = Vector< short, 3 >
 
using Vector3i = Vector< int, 3 >
 
using Vector3u = Vector< uint, 3 >
 
using Vector3b = Vector< Byte, 3 >
 
using Vector4d = Vector< double, 4 >
 
using Vector4f = Vector< float, 4 >
 
using Vector4s = Vector< short, 4 >
 
using Vector4i = Vector< int, 4 >
 
using Vector4u = Vector< uint, 4 >
 
using Vector4b = Vector< Byte, 4 >
 
using Vertex2d = Vector2d
 
using Vertex2f = Vector2f
 
using Vertex2s = Vector2s
 
using Vertex2i = Vector2i
 
using Vertex2u = Vector2u
 
using Vertex2b = Vector2b
 
using Vertex3d = Vector3d
 
using Vertex3f = Vector3f
 
using Vertex3s = Vector3s
 
using Vertex3i = Vector3i
 
using Vertex3u = Vector3u
 
using Vertex3b = Vector3b
 
using Vertex4d = Vector4d
 
using Vertex4f = Vector4f
 
using Vertex4s = Vector4s
 
using Vertex4i = Vector4i
 
using Vertex4u = Vector4u
 
using Vertex4b = Vector4b
 
typedef Initializer< Vector4dVector4dInitializer
 
typedef Initializer< Vector4fVector4fInitializer
 
typedef Initializer< Vector4sVector4sInitializer
 
typedef Initializer< Vector4bVector4bInitializer
 
typedef Initializer< Vector3dVector3dInitializer
 
typedef Initializer< Vector3fVector3fInitializer
 
typedef Initializer< Vector3sVector3sInitializer
 
typedef Initializer< Vector3bVector3bInitializer
 
typedef Initializer< Vector2dVector2dInitializer
 
typedef Initializer< Vector2fVector2fInitializer
 
typedef Initializer< Vector2sVector2sInitializer
 
typedef Initializer< Vector2bVector2bInitializer
 
typedef VectorArray< Vector4dVector4dArray
 
typedef VectorArray< Vector4fVector4fArray
 
typedef VectorArray< Vector4sVector4sArray
 
typedef VectorArray< Vector4iVector4iArray
 
typedef VectorArray< Vector4bVector4bArray
 
typedef VectorArray< Vector3dVector3dArray
 
typedef VectorArray< Vector3fVector3fArray
 
typedef VectorArray< Vector3sVector3sArray
 
typedef VectorArray< Vector3iVector3iArray
 
typedef VectorArray< Vector3bVector3bArray
 
typedef VectorArray< Vector2dVector2dArray
 
typedef VectorArray< Vector2fVector2fArray
 
typedef VectorArray< Vector2sVector2sArray
 
typedef VectorArray< Vector2iVector2iArray
 
typedef VectorArray< Vector2bVector2bArray
 
typedef Vector4dArray Vertex4dArray
 
typedef Vector4fArray Vertex4fArray
 
typedef Vector4sArray Vertex4sArray
 
typedef Vector4iArray Vertex4iArray
 
typedef Vector4bArray Vertex4bArray
 
typedef Vector3dArray Vertex3dArray
 
typedef Vector3fArray Vertex3fArray
 
typedef Vector3sArray Vertex3sArray
 
typedef Vector3iArray Vertex3iArray
 
typedef Vector3bArray Vertex3bArray
 
typedef Vector2dArray Vertex2dArray
 
typedef Vector2fArray Vertex2fArray
 
typedef Vector2sArray Vertex2sArray
 
typedef Vector2iArray Vertex2iArray
 
typedef Vector2bArray Vertex2bArray
 

Functions

template<typename T , uint LENGTH>
bool compare (const Vector< T, LENGTH > &v1, const Vector< T, LENGTH > &v2, T precision)
 
template<typename T , uint LENGTH>
const std::istream & operator>> (std::istream &is, Vector< T, LENGTH > &v)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator+ (const Vector< T, LENGTH > &v1, const Vector< T, LENGTH > &v2)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator- (const Vector< T, LENGTH > &v1, const Vector< T, LENGTH > &v2)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator- (const Vector< T, LENGTH+1 > &v1, const Vector< T, LENGTH+1 > &v2)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator* (const T scalar, const Vector< T, LENGTH > &v1)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator* (const Vector< T, LENGTH > &v1, const T scalar)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator/ (const T scalar, const Vector< T, LENGTH > &v1)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator/ (const Vector< T, LENGTH > &v1, const T scalar)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator- (const Vector< T, LENGTH > &v1)
 
template<typename T , uint LENGTH>
const T dot (const Vector< T, LENGTH+1 > &v1, const Vector< T, LENGTH > &v2)
 
template<typename T , uint LENGTH>
const T dot (const Vector< T, LENGTH > &v1, const Vector< T, LENGTH > &v2)
 
template<typename T >
const T det (const Vector< T, 2 > &v1, const Vector< T, 2 > &v2)
 
template<typename T >
const T det (const Vector< T, 3 > &v1, const Vector< T, 3 > &v2, const Vector< T, 3 > &v3)
 
template<typename T >
const Vector< T, 2 > cross (const Vector< T, 2 > &v1, const Vector< T, 2 > &v2)
 
template<typename T >
const Vector< T, 3 > cross (const Vector< T, 3 > &v1, const Vector< T, 3 > &v2)
 
template<typename T >
const Vector< T, 4 > cross (const Vector< T, 4 > &v1, const Vector< T, 4 > &v2)
 
template<typename T >
const Vector< T, 3 > triple (const Vector< T, 3 > &v1, const Vector< T, 3 > &v2, const Vector< T, 3 > &v3)
 
template<typename T , uint LENGTH>
const Vector< T, 4 > planeEquation (const Vector< T, LENGTH > &v1, const Vector< T, LENGTH > &v2, const Vector< T, LENGTH > &v3)
 
template<typename T , uint LENGTH>
const Vector< T, LENGTH > perp (const Vector< T, LENGTH > &vec)
 
template<typename T , uint LENGTH>
T angleRadians (const Vector< T, LENGTH > &v1, const Vector< T, LENGTH > &v2)
 

Typedef Documentation

◆ Vector2b

using Vector2b = Vector< Byte, 2 >

◆ Vector2bArray

◆ Vector2bInitializer

typedef Initializer< Vector2b > Vector2bInitializer

◆ Vector2d

using Vector2d = Vector< double, 2 >

◆ Vector2dArray

◆ Vector2dInitializer

typedef Initializer< Vector2d > Vector2dInitializer

◆ Vector2f

using Vector2f = Vector< float, 2 >

◆ Vector2fArray

◆ Vector2fInitializer

typedef Initializer< Vector2f > Vector2fInitializer

◆ Vector2i

using Vector2i = Vector< int, 2 >

◆ Vector2iArray

◆ Vector2s

using Vector2s = Vector< short, 2 >

◆ Vector2sArray

◆ Vector2sInitializer

typedef Initializer< Vector2s > Vector2sInitializer

◆ Vector2u

using Vector2u = Vector< uint, 2 >

◆ Vector3b

using Vector3b = Vector< Byte, 3 >

◆ Vector3bArray

◆ Vector3bInitializer

typedef Initializer< Vector3b > Vector3bInitializer

◆ Vector3d

using Vector3d = Vector< double, 3 >

◆ Vector3dArray

◆ Vector3dInitializer

typedef Initializer< Vector3d > Vector3dInitializer

◆ Vector3f

using Vector3f = Vector< float, 3 >

◆ Vector3fArray

◆ Vector3fInitializer

typedef Initializer< Vector3f > Vector3fInitializer

◆ Vector3i

using Vector3i = Vector< int, 3 >

◆ Vector3iArray

◆ Vector3s

using Vector3s = Vector< short, 3 >

◆ Vector3sArray

◆ Vector3sInitializer

typedef Initializer< Vector3s > Vector3sInitializer

◆ Vector3u

using Vector3u = Vector< uint, 3 >

◆ Vector4b

using Vector4b = Vector< Byte, 4 >

◆ Vector4bArray

◆ Vector4bInitializer

typedef Initializer< Vector4b > Vector4bInitializer

◆ Vector4d

using Vector4d = Vector< double, 4 >

◆ Vector4dArray

◆ Vector4dInitializer

typedef Initializer< Vector4d > Vector4dInitializer

◆ Vector4f

using Vector4f = Vector< float, 4 >

◆ Vector4fArray

◆ Vector4fInitializer

typedef Initializer< Vector4f > Vector4fInitializer

◆ Vector4i

using Vector4i = Vector< int, 4 >

◆ Vector4iArray

◆ Vector4s

using Vector4s = Vector< short, 4 >

◆ Vector4sArray

◆ Vector4sInitializer

typedef Initializer< Vector4s > Vector4sInitializer

◆ Vector4u

using Vector4u = Vector< uint, 4 >

◆ Vertex2b

using Vertex2b = Vector2b

◆ Vertex2bArray

◆ Vertex2d

using Vertex2d = Vector2d

◆ Vertex2dArray

◆ Vertex2f

using Vertex2f = Vector2f

◆ Vertex2fArray

◆ Vertex2i

using Vertex2i = Vector2i

◆ Vertex2iArray

◆ Vertex2s

using Vertex2s = Vector2s

◆ Vertex2sArray

◆ Vertex2u

using Vertex2u = Vector2u

◆ Vertex3b

using Vertex3b = Vector3b

◆ Vertex3bArray

◆ Vertex3d

using Vertex3d = Vector3d

◆ Vertex3dArray

◆ Vertex3f

using Vertex3f = Vector3f

◆ Vertex3fArray

◆ Vertex3i

using Vertex3i = Vector3i

◆ Vertex3iArray

◆ Vertex3s

using Vertex3s = Vector3s

◆ Vertex3sArray

◆ Vertex3u

using Vertex3u = Vector3u

◆ Vertex4b

using Vertex4b = Vector4b

◆ Vertex4bArray

◆ Vertex4d

using Vertex4d = Vector4d

◆ Vertex4dArray

◆ Vertex4f

using Vertex4f = Vector4f

◆ Vertex4fArray

◆ Vertex4i

using Vertex4i = Vector4i

◆ Vertex4iArray

◆ Vertex4s

using Vertex4s = Vector4s

◆ Vertex4sArray

◆ Vertex4u

using Vertex4u = Vector4u

Function Documentation

◆ angleRadians()

template<typename T , uint LENGTH>
T angleRadians ( const Vector< T, LENGTH > & v1,
const Vector< T, LENGTH > & v2 )

◆ compare()

template<typename T , uint LENGTH>
bool compare ( const Vector< T, LENGTH > & v1,
const Vector< T, LENGTH > & v2,
T precision )

◆ cross() [1/3]

template<typename T >
const Vector< T, 2 > cross ( const Vector< T, 2 > & v1,
const Vector< T, 2 > & v2 )

◆ cross() [2/3]

template<typename T >
const Vector< T, 3 > cross ( const Vector< T, 3 > & v1,
const Vector< T, 3 > & v2 )

◆ cross() [3/3]

template<typename T >
const Vector< T, 4 > cross ( const Vector< T, 4 > & v1,
const Vector< T, 4 > & v2 )

◆ det() [1/2]

template<typename T >
const T det ( const Vector< T, 2 > & v1,
const Vector< T, 2 > & v2 )

◆ det() [2/2]

template<typename T >
const T det ( const Vector< T, 3 > & v1,
const Vector< T, 3 > & v2,
const Vector< T, 3 > & v3 )

◆ dot() [1/2]

template<typename T , uint LENGTH>
const T dot ( const Vector< T, LENGTH > & v1,
const Vector< T, LENGTH > & v2 )

◆ dot() [2/2]

template<typename T , uint LENGTH>
const T dot ( const Vector< T, LENGTH+1 > & v1,
const Vector< T, LENGTH > & v2 )

◆ operator*() [1/2]

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator* ( const T scalar,
const Vector< T, LENGTH > & v1 )

◆ operator*() [2/2]

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator* ( const Vector< T, LENGTH > & v1,
const T scalar )

◆ operator+()

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator+ ( const Vector< T, LENGTH > & v1,
const Vector< T, LENGTH > & v2 )

◆ operator-() [1/3]

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator- ( const Vector< T, LENGTH > & v1)

◆ operator-() [2/3]

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator- ( const Vector< T, LENGTH > & v1,
const Vector< T, LENGTH > & v2 )

◆ operator-() [3/3]

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator- ( const Vector< T, LENGTH+1 > & v1,
const Vector< T, LENGTH+1 > & v2 )

◆ operator/() [1/2]

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator/ ( const T scalar,
const Vector< T, LENGTH > & v1 )

◆ operator/() [2/2]

template<typename T , uint LENGTH>
const Vector< T, LENGTH > operator/ ( const Vector< T, LENGTH > & v1,
const T scalar )

◆ operator>>()

template<typename T , uint LENGTH>
const std::istream & operator>> ( std::istream & is,
Vector< T, LENGTH > & v )
inline

◆ perp()

template<typename T , uint LENGTH>
const Vector< T, LENGTH > perp ( const Vector< T, LENGTH > & vec)

◆ planeEquation()

template<typename T , uint LENGTH>
const Vector< T, 4 > planeEquation ( const Vector< T, LENGTH > & v1,
const Vector< T, LENGTH > & v2,
const Vector< T, LENGTH > & v3 )

◆ triple()

template<typename T >
const Vector< T, 3 > triple ( const Vector< T, 3 > & v1,
const Vector< T, 3 > & v2,
const Vector< T, 3 > & v3 )