-
-
Add this vector with another vector element wise
| Name |
Type |
Description |
other |
Vector
|
The other vector |
Returns:
| Type |
Description |
|
Vector
|
The vector result of adding the two vectors |
-
-
Get the cross product of this and the other vector
| Name |
Type |
Description |
other |
Vector
|
The other vector |
Returns:
| Type |
Description |
|
number
|
The cross product of this and the other vector |
-
-
Divide the vector by a scalar value
| Name |
Type |
Description |
scalar |
number
|
|
Returns:
| Type |
Description |
|
Vector
|
The result of multiplying the vector by a scalar |
-
-
Get the dot product of this vector and another vector
| Name |
Type |
Description |
other |
Vector
|
The other vector |
Returns:
| Type |
Description |
|
number
|
The dot product of this and the other vector |
-
-
Get the vector key:Symbol representation
Returns:
| Type |
Description |
|
Symbol
|
The vector key element |
-
-
Get the vector in list form
Returns:
| Type |
Description |
|
Array.<number>
|
List representation of the vector of length 2 |
-
-
Get the magnitude of the vector
Returns:
| Type |
Description |
|
number
|
The magniture of the vector |
-
-
Multiply the vector by a scalar value
| Name |
Type |
Description |
scalar |
number
|
The number to multiply the vector by |
Returns:
| Type |
Description |
|
Vector
|
The result of multiplying the vector by a scalar
element wise |
-
-
Get the normal vector of the current vector.
Returns:
| Type |
Description |
|
Vector
|
A vector that is the normal compenent of the vector |
-
-
Get the two normal vectors that are perpendicular to the current vector
Returns:
| Type |
Description |
|
Array.<Vector>
|
The two normal vectors that are perpendicular
to the vector. The first vector is the normal vector that is +90 deg or
+PI/2 rad. The second vector is the noraml vector that is -90 deg or
-PI/2 rad. |
-
-
Get the get the current vector rotated by a certain ammount
| Name |
Type |
Description |
radians |
number
|
|
Returns:
| Type |
Description |
|
Vector
|
The vector that results from rotating the current
vector by a particular ammount |
-
-
Subtract this vector with another vector element wise
| Name |
Type |
Description |
other |
Vector
|
The other vector |
Returns:
| Type |
Description |
|
Vector
|
The vector result of subtracting the two vectors |
-
-
Returns the vector as a string of (x, y)
Returns:
| Type |
Description |
|
string
|
The string representation of a vector in (x, y) form |