SketchUp 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 <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...
 

Detailed Description

Represents a vector in 2-dimensional space.

Friends And Related Function Documentation

enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult 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
enum SUResult SUVector2DNormalize ( struct SUVector2D vector)
related

Normalizes a vector.

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

Reverses a vector.

Since
SketchUp 2017, API 5.0
Parameters
[in]vectorThe vector object.
Returns
enum SUResult 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
enum SUResult 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

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