LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Fields | Related Functions
SUVector2D Struct Reference

Represents a vector in 2-dimensional space. More...

#include <geometry.h>

Data Fields

double x
 X magnitude. More...
 
double y
 Y magnitude. More...
 

Related Functions

(Note that these are not member functions.)

SU_RESULT SUVector2DCreate (struct SUVector2D *vector, const struct SUPoint2D *from, const struct SUPoint2D *to)
 Creates a vector between two point objects. More...
 
SU_RESULT SUVector2DIsValid (const struct SUVector2D *vector, bool *valid)
 Determines if a vector is valid. A vector is invalid if its length is zero. More...
 
SU_RESULT SUVector2DIsParallelTo (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *parallel)
 Determines if two vectors are parallel. More...
 
SU_RESULT SUVector2DIsPerpendicularTo (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *perpendicular)
 Determines if two vectors are perpendicular. More...
 
SU_RESULT SUVector2DIsSameDirectionAs (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *same_direction)
 Determines if two vectors are parallel and pointing the same direction. More...
 
SU_RESULT SUVector2DIsEqual (const struct SUVector2D *vector1, const struct SUVector2D *vector2, bool *equal)
 Determines if two vectors are equal. More...
 
SU_RESULT SUVector2DNormalize (struct SUVector2D *vector)
 Normalizes a vector. More...
 
SU_RESULT SUVector2DReverse (struct SUVector2D *vector)
 Reverses a vector. More...
 
SU_RESULT SUVector2DDot (const struct SUVector2D *vector1, const struct SUVector2D *vector2, double *dot)
 Computes the dot product of two vectors. More...
 
SU_RESULT SUVector2DCross (const struct SUVector2D *vector1, const struct SUVector2D *vector2, double *cross)
 Computes the cross product of two vectors. More...
 
SU_RESULT SUVector2DIsUnitVector (const struct SUVector2D *vector, bool *is_unit_vector)
 Determines if a vector has a length of one. More...
 
SU_RESULT SUVector2DGetLength (const struct SUVector2D *vector, double *length)
 Gets the length of a vector. More...
 
SU_RESULT SUVector2DSetLength (struct SUVector2D *vector, double length)
 Sets the length of a vector. More...
 
SU_RESULT SUVector2DAngleBetween (const struct SUVector2D *vector1, const struct SUVector2D *vector2, double *angle)
 Gets the angle between two vectors. More...
 
SU_RESULT SUVector2DTransform (const struct SUTransformation2D *transform, struct SUVector2D *vector)
 Transforms a vector by applying a 2D transformation. More...
 

Detailed Description

Represents a vector in 2-dimensional space.

Friends And Related Function Documentation

SU_RESULT SUVector2DAngleBetween ( const struct SUVector2D vector1,
const struct SUVector2D vector2,
double *  angle 
)
related

Gets the angle between two vectors.

Since
SketchUp 2017, API 5.0
Parameters
[in]vector1The first vector object.
[in]vector2The second vector object.
[out]angleThe angle between the vectors.
Returns
SU_RESULT SUVector2DCreate ( struct SUVector2D vector,
const struct SUPoint2D from,
const struct SUPoint2D to 
)
related

Creates a vector between two point objects.

Since
SketchUp 2018 M0, API 6.0
Parameters
[in]fromThe first point object.
[in]toThe second point object.
[out]vectorThe vector from from to to.
Returns
SU_RESULT SUVector2DCross ( const struct SUVector2D vector1,
const struct SUVector2D vector2,
double *  cross 
)
related

Computes the cross product of two vectors.

Since
SketchUp 2017, API 5.0
Parameters
[in]vector1The first vector object.
[in]vector2The second vector object.
[out]crossThe value of the cross product.
Returns
SU_RESULT SUVector2DDot ( const struct SUVector2D vector1,
const struct SUVector2D vector2,
double *  dot 
)
related

Computes the dot product of two vectors.

Since
SketchUp 2017, API 5.0
Parameters
[in]vector1The first vector object.
[in]vector2The second vector object.
[out]dotThe value of the dot product.
Returns
SU_RESULT SUVector2DGetLength ( const struct SUVector2D vector,
double *  length 
)
related

Gets the length of a vector.

Since
SketchUp 2017, API 5.0
Parameters
[in]vectorThe vector object.
[out]lengthThe length of the vector.
Returns
SU_RESULT SUVector2DIsEqual ( const struct SUVector2D vector1,
const struct SUVector2D vector2,
bool *  equal 
)
related

Determines if two vectors are equal.

Since
SketchUp 2018, API 6.0
Parameters
[in]vector1The first vector object.
[in]vector2The second vector object.
[out]equalWhether the vectors are equal.
Returns
SU_RESULT SUVector2DIsParallelTo ( const struct SUVector2D vector1,
const struct SUVector2D vector2,
bool *  parallel 
)
related

Determines if two vectors are parallel.

Since
SketchUp 2017, API 5.0
Parameters
[in]vector1The first vector object.
[in]vector2The second vector object.
[out]parallelWhether the vectors are parallel.
Returns
SU_RESULT SUVector2DIsPerpendicularTo ( const struct SUVector2D vector1,
const struct SUVector2D vector2,
bool *  perpendicular 
)
related

Determines if two vectors are perpendicular.

Since
SketchUp 2017, API 5.0
Parameters
[in]vector1The first vector object.
[in]vector2The second vector object.
[out]perpendicularWhether the vectors are perpendicular.
Returns
SU_RESULT SUVector2DIsSameDirectionAs ( const struct SUVector2D vector1,
const struct SUVector2D vector2,
bool *  same_direction 
)
related

Determines if two vectors are parallel and pointing the same direction.

Since
SketchUp 2017, API 5.0
Parameters
[in]vector1The first vector object.
[in]vector2The second vector object.
[out]same_directionWhether the vectors are pointing in the same direction.
Returns
SU_RESULT SUVector2DIsUnitVector ( const struct SUVector2D vector,
bool *  is_unit_vector 
)
related

Determines if a vector has a length of one.

Since
SketchUp 2017, API 5.0
Parameters
[in]vectorThe vector object.
[out]is_unit_vectorWhether the vector has a length of one.
Returns
SU_RESULT SUVector2DIsValid ( const struct SUVector2D vector,
bool *  valid 
)
related

Determines if a vector is valid. A vector is invalid if its length is zero.

Since
SketchUp 2017, API 5.0
Parameters
[in]vectorThe vector object.
[out]validWhether the vector is valid.
Returns
SU_RESULT SUVector2DNormalize ( struct SUVector2D vector)
related

Normalizes a vector.

Since
SketchUp 2017, API 5.0
Parameters
[in,out]vectorThe vector object.
Returns
SU_RESULT SUVector2DReverse ( struct SUVector2D vector)
related

Reverses a vector.

Since
SketchUp 2017, API 5.0
Parameters
[in]vectorThe vector object.
Returns
SU_RESULT SUVector2DSetLength ( struct SUVector2D vector,
double  length 
)
related

Sets the length of a vector.

Since
SketchUp 2017, API 5.0
Parameters
[in,out]vectorThe vector object.
[in]lengthThe new length the vector should be.
Returns
SU_RESULT SUVector2DTransform ( const struct SUTransformation2D transform,
struct SUVector2D vector 
)
related

Transforms a vector by applying a 2D transformation.

Since
SketchUp 2019, API 7.0
Parameters
[in]transformThe transformation to be applied.
[in,out]vectorThe vector to be transformed.
Returns

Field Documentation

double SUVector2D::x

X magnitude.

double SUVector2D::y

Y magnitude.


The documentation for this struct was generated from the following files: