#include <vector.h>
◆ Vector() [1/3]
◆ Vector() [2/3]
Creates a Vector with arbitrary x and y values.
- Parameters
-
◆ Vector() [3/3]
Creates a new Vector that is a copy of the given Vector
- Parameters
-
◆ createFromAngle()
◆ cross()
Takes the cross product of two vectors
- Parameters
-
- Returns
- the z component of the 3-dimensional cross product between this Vector and the other Vector
◆ determinant()
Calculates the determinant of a 2x2 matrix
- Parameters
-
| other | Vector forming the bottom row of the matrix |
- Returns
- the determinant with rows from the specified vectors
◆ dot()
Takes the dot product of two vectors
- Parameters
-
| other | the Vector to dot against |
- Returns
- the dot product of the vectors
◆ isClockwiseOf()
Returns true if this vector is to the right of the given vector. Geometrically, in the acute angle given by two vectors, it returns true if this vector is clockwise of the other vector.
- Parameters
-
◆ isCounterClockwiseOf()
In the acute angle given by the two vectors, this function returns true if this vector is counterclockwise of the other vector.
- Parameters
-
◆ length()
Returns the length of the Vector
- Returns
- the length of the Vector
◆ lengthSquared()
| double lengthSquared |
( |
| ) |
const |
Returns the square of the length of the Vector
- Returns
- the square of the length of the Vector
◆ normalize() [1/2]
Returns this Vector as a unit vector in the same direction
- Returns
- Vector a unit vector in the same direction as this Vector, or a zero-vector if this Vector is a zero-vector
◆ normalize() [2/2]
Returns a scaled normalized vector in the same direction as this Vector
- Parameters
-
| length | the desired length of the resultant vector |
- Returns
- a vector in the same direction as this Vector and with the given length, or a zero-vector if this Vector is a zero-vector
◆ operator=()
Assigns one Vector to another
- Parameters
-
| other | the Vector whose x and y magnitudes should be copied into this Vector |
- Returns
- this Vector
◆ orientation()
| Angle orientation |
( |
| ) |
const |
Returns the direction of this Vector
- Returns
- the direction of this Vector, in the range [-π, π], with 0 being the positive x direction, π/2 being up (positive y), etc. like on a standard x-y plane
+
| Y
|
|
+---------------+
-X | X
|
| -Y
+
◆ perpendicular()
| Vector perpendicular |
( |
| ) |
const |
Returns the vector perpendicular to this Vector (rotated +90 degrees from the original vector)
- Returns
- a vector perpendicular to this Vector
◆ project()
Projects this vector onto the line formed by another vector
- Parameters
-
| the | vector to project onto |
- Returns
- the projection of this vector onto the line formed by the given Vector
◆ rotate()
Rotates this Vector counterclockwise by an angle
- Parameters
-
| rot | the angle to rotate the vector |
- Returns
- the Vector rotated by rot
◆ set()
| void set |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Sets the magnitudes of this vector to the new magnitudes
- Parameters
-
| x | the new magnitude in the x-coordinate |
| y | the new magnitude in the y-coordinate |
◆ setX()
Sets the magnitude in the x-coordinate of this vector
- Parameters
-
| x | the new x-coordinate magnitude |
◆ setY()
Sets the magnitude in the y-coordinate of this vector
- Parameters
-
| y | the new y-coordinate magnitude |
◆ x()
Returns the magnitude in the x-coordinate of this Vector
- Returns
- the magnitude in the x-coordinate of this Vector
◆ y()
Returns the magnitude in the y-coordinate of this Vector
- Returns
- the magnitude in the y-coordinate of this Vector
The documentation for this class was generated from the following files:
- src/software/geom/vector.h
- src/software/geom/vector.cpp