LayOut C API
|
Represents a vector in 3-dimensional space. More...
#include <geometry.h>
Data Fields | |
double | x |
X magnitude. More... | |
double | y |
Y magnitude. More... | |
double | z |
Z magnitude. More... | |
Related Functions | |
(Note that these are not member functions.) | |
SU_RESULT | SUVector3DCreate (struct SUVector3D *vector, const struct SUPoint3D *from, const struct SUPoint3D *to) |
Creates a vector between two point objects. More... | |
SU_RESULT | SUVector3DIsValid (const struct SUVector3D *vector, bool *valid) |
Determines if a vector is valid. A vector is invalid if its length is zero. More... | |
SU_RESULT | SUVector3DIsParallelTo (const struct SUVector3D *vector1, const struct SUVector3D *vector2, bool *parallel) |
Determines if two vectors are parallel. More... | |
SU_RESULT | SUVector3DIsPerpendicularTo (const struct SUVector3D *vector1, const struct SUVector3D *vector2, bool *perpendicular) |
Determines if two vectors are perpendicular. More... | |
SU_RESULT | SUVector3DIsSameDirectionAs (const struct SUVector3D *vector1, const struct SUVector3D *vector2, bool *same_direction) |
Determines if two vectors are parallel and pointing the same direction. More... | |
SU_RESULT | SUVector3DIsEqual (const struct SUVector3D *vector1, const struct SUVector3D *vector2, bool *equal) |
Determines if two vectors are equal. More... | |
SU_RESULT | SUVector3DLessThan (const struct SUVector3D *vector1, const struct SUVector3D *vector2, bool *less_than) |
Determines if vector1 is less than vector2. More... | |
SU_RESULT | SUVector3DNormalize (struct SUVector3D *vector) |
Normalizes a vector. More... | |
SU_RESULT | SUVector3DReverse (struct SUVector3D *vector) |
Reverses a vector. More... | |
SU_RESULT | SUVector3DDot (const struct SUVector3D *vector1, const struct SUVector3D *vector2, double *dot) |
Computes the dot product of two vectors. More... | |
SU_RESULT | SUVector3DCross (const struct SUVector3D *vector1, const struct SUVector3D *vector2, struct SUVector3D *cross) |
Computes the cross product of two vectors. More... | |
SU_RESULT | SUVector3DIsUnitVector (const struct SUVector3D *vector, bool *is_unit_vector) |
Determines if a vector has a length of one. More... | |
SU_RESULT | SUVector3DGetLength (const struct SUVector3D *vector, double *length) |
Gets the length of a vector. More... | |
SU_RESULT | SUVector3DSetLength (struct SUVector3D *vector, double length) |
Sets the length of a vector. More... | |
SU_RESULT | SUVector3DAngleBetween (const struct SUVector3D *vector1, const struct SUVector3D *vector2, double *angle) |
Gets the angle between two vectors. More... | |
SU_RESULT | SUVector3DGetArbitraryAxes (const struct SUVector3D *z_axis, struct SUVector3D *x_axis, struct SUVector3D *y_axis) |
Get arbitrary axes perpendicular to this vector. This method uses the arbitrary axis algorithm to calculate the x and y vectors. More... | |
SU_RESULT | SUVector3DTransform (const struct SUTransformation *transform, struct SUVector3D *vector) |
Transforms the provided 3D vector by applying the provided 3D transformation. More... | |
SU_RESULT | SUVector3DLinearCombination (const struct SUVector3D *vectors, const double *weights, const size_t size, struct SUVector3D *vector) |
Creates a new vector as a linear combination of other vectors. This method is generally used to get a vector at some percentage between two vectors. More... | |
Represents a vector in 3-dimensional space.
|
related |
Gets the angle between two vectors.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | angle | The angle between the vectors. |
|
related |
Creates a vector between two point objects.
[in] | from | The first point object. |
[in] | to | The second point object. |
[out] | vector | The vector from from to to. |
|
related |
Computes the cross product of two vectors.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | cross | The value of the cross product. |
|
related |
Computes the dot product of two vectors.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | dot | The value of the dot product. |
|
related |
Get arbitrary axes perpendicular to this vector. This method uses the arbitrary axis algorithm to calculate the x and y vectors.
[in] | z_axis | The vector to use as the z axis. |
[out] | x_axis | The computed x axis vector. |
[out] | y_axis | The computed y axis vector. |
|
related |
Gets the length of a vector.
[in] | vector | The vector object. |
[out] | length | The length of the vector. |
|
related |
Determines if two vectors are equal.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | equal | Whether the vectors are equal. |
|
related |
Determines if two vectors are parallel.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | parallel | Whether the vectors are parallel. |
|
related |
Determines if two vectors are perpendicular.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | perpendicular | Whether the vectors are perpendicular. |
|
related |
Determines if two vectors are parallel and pointing the same direction.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | same_direction | Whether the vectors are pointing in the same direction. |
|
related |
Determines if a vector has a length of one.
[in] | vector | The vector object. |
[out] | is_unit_vector | Whether the vector has a length of one. |
|
related |
Determines if a vector is valid. A vector is invalid if its length is zero.
[in] | vector | The vector object. |
[out] | valid | Whether the vector is valid. |
|
related |
Determines if vector1 is less than vector2.
[in] | vector1 | The first vector object. |
[in] | vector2 | The second vector object. |
[out] | less_than | Whether vector1 is less than vector2. |
|
related |
Creates a new vector as a linear combination of other vectors. This method is generally used to get a vector at some percentage between two vectors.
[in] | vectors | An array of vectors. Must be size of 2 or 3. |
[in] | weights | An array of weights that correspond to the percentage. Must be the same size as vectors . |
[in] | size | The size of the vectors and weights array. |
[out] | vector | The new computed vector. |
|
related |
Normalizes a vector.
[in,out] | vector | The vector object. |
|
related |
Reverses a vector.
[in,out] | vector | The vector object. |
|
related |
Sets the length of a vector.
[in,out] | vector | The vector object. |
[in] | length | The new length the vector should be. |
|
related |
Transforms the provided 3D vector by applying the provided 3D transformation.
[in] | transform | The transformation to be applied. |
[in,out] | vector | The vector to be transformed. |
double SUVector3D::x |
X magnitude.
double SUVector3D::y |
Y magnitude.
double SUVector3D::z |
Z magnitude.