Project

General

Profile

OpenSpace3D libs
OpenSpace 3D libraries for plugITs and OS3D developer

Functions

 minf (a, b)
 Get the smallest float value. More...
 
 zeroVector (vec)
 Test if a vector is set to 0. More...
 
 zeroVectorF (vec)
 Test if a float vector is set to 0. More...
 
 vectorIsZero (vec)
 Test if a vector is set to 0. More...
 
 vectorIsZeroF (vec)
 Test if a float vector is set to 0. More...
 
 vectorEqual (vec1, vec2)
 Test if two vectors are equal. More...
 
 vectorEqualF (vec1, vec2)
 Test if two float vectors are equal. More...
 
 normalizeVectorF (vec)
 Normalize a float vector. More...
 
 vectorAverageF (vec)
 Get the average of a vector. More...
 
 vectorCubeF (vec)
 Get the cube of a vector. More...
 
 getVectorLength (vec1)
 Get a vector length. More...
 
 getVectorLengthF (vec1)
 Get a vector length. More...
 
 getVectorDistance (vec1, vec2)
 Get the distance between 2 vectors. More...
 
 getVectorDistanceF (vec1, vec2)
 Get the distance between 2 vectors. More...
 
 crossVector (vec1, vec2)
 Cross product of two vectors. More...
 
 crossVectorF (vec1, vec2)
 Cross product of two vectors. More...
 
 dotVector (vec1, vec2)
 Dot product of two vectors. More...
 
 dotVectorF (vec1, vec2)
 Dot product of two vectors. More...
 
 subVector (vec1, vec2)
 Substract two vectors. More...
 
 subVectorF (vec1, vec2)
 Substract two float vectors. More...
 
 addVector (vec1, vec2)
 Add two vectors. More...
 
 addVectorF (vec1, vec2)
 Add two float vectors. More...
 
 divideVector (vec1, vec2)
 Divide two vectors. More...
 
 divideVectorF (vec1, vec2)
 Divide two float vectors. More...
 
 multiplyVector (vec1, vec2)
 Multiply two vectors. More...
 
 multiplyVectorF (vec1, vec2)
 Multiply two float vectors. More...
 
 getVectorXF (vec)
 Get vector X value. More...
 
 getVectorYF (vec)
 Get vector Y value. More...
 
 getVectorZF (vec)
 Get vector Z value. More...
 
 getShortestAngle (p, q)
 Get the shortest angle. More...
 
 quatInverse (quat)
 Get quaternion inverse. More...
 

Detailed Description

Vector tools

Function Documentation

◆ minf()

minf ( ,
 
)

Get the smallest float value.

Prototype: fun [F F] F

Parameters
F: first value
F: second value
Returns
F : the smallest value

◆ zeroVector()

zeroVector ( vec  )

Test if a vector is set to 0.

Prototype: fun [[I I I]] I

Parameters
[II I] : int vector
Returns
I : 1 if the vector is 0, 0 otherwise

◆ zeroVectorF()

zeroVectorF ( vec  )

Test if a float vector is set to 0.

Prototype: fun [[F F F]] I

Parameters
[FF F] : float vector
Returns
I : 1 if the vector is 0, 0 otherwise

◆ vectorIsZero()

vectorIsZero ( vec  )

Test if a vector is set to 0.

Prototype: fun [[I I I]] I

Parameters
[II I] : int vector
Returns
I : 1 if the vector is 0, 0 otherwise

◆ vectorIsZeroF()

vectorIsZeroF ( vec  )

Test if a float vector is set to 0.

Prototype: fun [[F F F]] I

Parameters
[FF F] : float vector
Returns
I : 1 if the vector is 0, 0 otherwise

◆ vectorEqual()

vectorEqual ( vec1  ,
vec2   
)

Test if two vectors are equal.

Prototype: fun [[I I I] [I I I]] I

Parameters
[II I] : first int vector
[II I] : second int vector
Returns
I : 1 if the two vectors are equal, 0 otherwise

◆ vectorEqualF()

vectorEqualF ( vec1  ,
vec2   
)

Test if two float vectors are equal.

Prototype: fun [[F F F] [F F F]] I

Parameters
[FF F] : first float vector
[FF F] : second float vector
Returns
I : 1 if the two vectors are equal, 0 otherwise

◆ normalizeVectorF()

normalizeVectorF ( vec  )

Normalize a float vector.

Prototype: fun [[F F F]] [F F F]

Parameters
[FF F] : float vector
Returns
[F F F] : normalized float vector

◆ vectorAverageF()

vectorAverageF ( vec  )

Get the average of a vector.

Prototype: fun [[F F F]] F

Parameters
[FF F] : float vector
Returns
F : average

◆ vectorCubeF()

vectorCubeF ( vec  )

Get the cube of a vector.

Prototype: fun [[F F F]] F

Parameters
[FF F] : float vector
Returns
F : cube (x * y * z)

◆ getVectorLength()

getVectorLength ( vec1  )

Get a vector length.

Prototype: fun [[I I I]] F

Parameters
[II I] : int vector
Returns
F : vector length

◆ getVectorLengthF()

getVectorLengthF ( vec1  )

Get a vector length.

Prototype: fun [[F F F]] F

Parameters
[FF F] : float vector
Returns
F : vector length

◆ getVectorDistance()

getVectorDistance ( vec1  ,
vec2   
)

Get the distance between 2 vectors.

Prototype: fun [[I I I] [I I I]] F

Parameters
[II I] : int vector
[II I] : int vector
Returns
F : vector length

◆ getVectorDistanceF()

getVectorDistanceF ( vec1  ,
vec2   
)

Get the distance between 2 vectors.

Prototype: fun [[F F F] [F F F]] F

Parameters
[FF F] : float vector
[FF F] : float vector
Returns
F : vector length

◆ crossVector()

crossVector ( vec1  ,
vec2   
)

Cross product of two vectors.

Prototype: fun [[I I I] [I I I]] [I I I]

Parameters
[II I] : first int vector
[II I] : second int vector
Returns
[I I I] : vector result

◆ crossVectorF()

crossVectorF ( vec1  ,
vec2   
)

Cross product of two vectors.

Prototype: fun [[F F F] [F F F]] [F F F]

Parameters
[FF F] : first float vector
[FF F] : second float vector
Returns
[F F F] : float vector result

◆ dotVector()

dotVector ( vec1  ,
vec2   
)

Dot product of two vectors.

Prototype: fun [[I I I] [I I I]] [I I I]

Parameters
[II I] : first int vector
[II I] : second int vector
Returns
F : dot product result

◆ dotVectorF()

dotVectorF ( vec1  ,
vec2   
)

Dot product of two vectors.

Prototype: fun [[F F F] [F F F]] [F F F]

Parameters
[FF F] : first float vector
[FF F] : second float vector
Returns
F : dot product result

◆ subVector()

subVector ( vec1  ,
vec2   
)

Substract two vectors.

Prototype: fun [[I I I] [I I I]] [I I I]

Parameters
[II I] : first int vector
[II I] : second int vector
Returns
[I I I] : vector result

◆ subVectorF()

subVectorF ( vec1  ,
vec2   
)

Substract two float vectors.

Prototype: fun [[F F F] [F F F]] [F F F]

Parameters
[FF F] : first float vector
[FF F] : second float vector
Returns
[F F F] : float vector result

◆ addVector()

addVector ( vec1  ,
vec2   
)

Add two vectors.

Prototype: fun [[I I I] [I I I]] [I I I]

Parameters
[II I] : first int vector
[II I] : second int vector
Returns
[I I I] : vector result

◆ addVectorF()

addVectorF ( vec1  ,
vec2   
)

Add two float vectors.

Prototype: fun [[F F F] [F F F]] [F F F]

Parameters
[FF F] : first float vector
[FF F] : second float vector
Returns
[F F F] : float vector result

◆ divideVector()

divideVector ( vec1  ,
vec2   
)

Divide two vectors.

Prototype: fun [[I I I] [I I I]] [I I I]

Parameters
[II I] : first int vector
[II I] : second int vector
Returns
[I I I] : vector result

◆ divideVectorF()

divideVectorF ( vec1  ,
vec2   
)

Divide two float vectors.

Prototype: fun [[F F F] [F F F]] [F F F]

Parameters
[FF F] : first float vector
[FF F] : second float vector
Returns
[F F F] : float vector result

◆ multiplyVector()

multiplyVector ( vec1  ,
vec2   
)

Multiply two vectors.

Prototype: fun [[I I I] [I I I]] [I I I]

Parameters
[II I] : first int vector
[II I] : second int vector
Returns
[I I I] : vector result

◆ multiplyVectorF()

multiplyVectorF ( vec1  ,
vec2   
)

Multiply two float vectors.

Prototype: fun [[F F F] [F F F]] [F F F]

Parameters
[FF F] : first float vector
[FF F] : second float vector
Returns
[F F F] : float vector result

◆ getVectorXF()

getVectorXF ( vec  )

Get vector X value.

Prototype: fun [[F F F]] F

Parameters
[FF F] : float vector
Returns
F : X float result

◆ getVectorYF()

getVectorYF ( vec  )

Get vector Y value.

Prototype: fun [[F F F]] F

Parameters
[FF F] : float vector
Returns
F : Y float result

◆ getVectorZF()

getVectorZF ( vec  )

Get vector Z value.

Prototype: fun [[F F F]] F

Parameters
[FF F] : float vector
Returns
F : Z float result

◆ getShortestAngle()

getShortestAngle ( ,
 
)

Get the shortest angle.

Prototype: fun [F] F

Parameters
F: angle in degree
Returns
F : the shortest angle in degree

◆ quatInverse()

quatInverse ( quat  )

Get quaternion inverse.

Prototype: fun [[F F F F]] [F F F F]

Parameters
[FF F F] : quaternion
Returns
[F F F F] : the inversed quaternion