public class Vector2d extends java.lang.Object
| Constructor and Description |
|---|
Vector2d() |
Vector2d(double x,
double y) |
| Modifier and Type | Method and Description |
|---|---|
double |
dot(Vector2d vec)
Returns dot product of this vector with argument.
|
double |
magnitude()
Returns magnitude of vector.
|
void |
rotate(double angle)
Rotate a vector in Cartesian space.
|
double |
scalarProject(Vector2d vec)
Returns scalar projection of this vector onto argument.
|
public void rotate(double angle)
angle - angle in degrees by which to rotate vector counter-clockwise.public double dot(Vector2d vec)
vec - Vector with which to perform dot product.public double magnitude()
public double scalarProject(Vector2d vec)
vec - Vector onto which to project this vector.