SketchUp C API
|
Represents a vector in 2-dimensional space. More...
#include <SketchUpAPI/geometry.h>
Data Fields | |
double | x |
X magnitude. | |
double | y |
Y magnitude. | |
Related Functions | |
(Note that these are not member functions.) | |
enum SUResult | SUVector2DCreate (struct SUVector2D *vector, const struct SUPoint2D *from, const struct SUPoint2D *to) |
Creates a vector between two point objects. More... | |
enum SUResult | SUVector2DIsValid (const struct SUVector2D *vector, bool *valid) |
Determines if a vector is valid. A vector is invalid if its length is zero. More... | |
enum SUResult | SUVector2DIsParallelTo (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *parallel) |
Determines if two vectors are parallel. More... | |
enum SUResult | SUVector2DIsPerpendicularTo (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *perpendicular) |
Determines if two vectors are perpendicular. More... | |
enum SUResult | SUVector2DIsSameDirectionAs (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *same_direction) |
Determines if two vectors are parallel and pointing the same direction. More... | |
enum SUResult | SUVector2DIsEqual (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *equal) |
Determines if two vectors are equal. More... | |
enum SUResult | SUVector2DNormalize (struct SUVector2D *vector) |
Normalizes a vector. More... | |
enum SUResult | SUVector2DReverse (struct SUVector2D *vector) |
Reverses a vector. More... | |
enum SUResult | SUVector2DDot (const struct SUVector2D *vector1, const struct SUVector2D *vector2, double *dot) |
Computes the dot product of two vectors. More... | |
enum SUResult | SUVector2DCross (const struct SUVector2D *vector1, const struct SUVector2D *vector2, double *cross) |
Computes the cross product of two vectors. More... | |
enum SUResult | SUVector2DIsUnitVector (const struct SUVector2D *vector, bool *is_unit_vector) |
Determines if a vector has a length of one. More... | |
enum SUResult | SUVector2DGetLength (const struct SUVector2D *vector, double *length) |
Gets the length of a vector. More... | |
enum SUResult | SUVector2DSetLength (struct SUVector2D *vector, double length) |
Sets the length of a vector. More... | |
enum SUResult | SUVector2DAngleBetween (const struct SUVector2D *vector1, const struct SUVector2D *vector2, double *angle) |
Gets the angle between two vectors. More... | |
enum SUResult | SUVector2DTransform (const struct SUTransformation2D *transform, struct SUVector2D *vector) |
Transforms a vector by applying a 2D transformation. More... | |
Represents a vector in 2-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 |
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 |
Normalizes a vector.
[in,out] | vector | The vector object. |
|
related |
Reverses a vector.
[in] | 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 a vector by applying a 2D transformation.
[in] | transform | The transformation to be applied. |
[in,out] | vector | The vector to be transformed. |