Type | Description |
Function or value | Description |
|
|
Full Usage:
componentIn d v
Parameters:
Direction2D<'Coordinates>
v : Vector2D<'Units, 'Coordiantes>
Returns: Quantity<'Units>
|
|
|
|
|
|
Full Usage:
direction v
Parameters:
Vector2D<'Units, 'Coordinates>
Returns: Direction2D<'Coordinates> option
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Get the distance between two vectors squared. This function can be used to optimize some algorithms because you remove a square root call from the calculation which can be an expensive operation.
|
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Compare two vectors within a tolerance. Returns true if the difference between the two given vectors has magnitude less than the given tolerance.
|
|
|
|
|
Full Usage:
fromList list
Parameters:
float list
Returns: Vector2D<'Units, 'Coordinates> option
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Construct a vector perpendicular to the given vector, by rotating the given vector 90 degrees counterclockwise. The constructed vector will have the same length as the given vector. Alias for `Vector2D.rotateCounterclockwise`.
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Take a vector defined in local coordinates relative to a given reference frame, and return that vector expressed in global coordinates.
|
|
|
|
|
|
|
Full Usage:
projectionIn d v
Parameters:
Direction2D<'Coordinates>
v : Vector2D<'Units, 'Coordiantes>
Returns: Vector2D<'Units, 'Coordinates>
|
![]() ![]() ![]() ![]() ![]() ![]() Find the projection of a vector in a particular direction. Conceptually, this means splitting the original vector into a portion parallel to the given direction and a portion perpendicular to it, then returning the parallel portion.
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Take a vector defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame.
|
|
|
|
|
|
|
|
|
|
![]() ![]() ![]() ![]() ![]() ![]() Rotate the given vector 90 degrees counterclockwise; Vector2D.rotateCounterclockwise vector is equivalent to Vector2D.rotateBy (Angle.degrees 90) vector but is more efficient.
|
|
![]() ![]() ![]() ![]() ![]() ![]() Rotate the given vector 90 degrees clockwise; Vector2D.rotateClockwise vector is equivalent to Vector2D.rotateBy (Angle.degrees -90) vector but is more efficient.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
withQuantity a d
Parameters:
Quantity<'Units>
d : Direction2D<'Coordinates>
Returns: Vector2D<'Units, 'Coordinates>
|
|
|
|
|
|
|
|
|
|
|