v2x-client
| java.lang.Object | |
| ↳ | com.commsignia.v2x.utils.vectors.Vector2D |
A class representing a vector in 2D space
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Vector2D(double x, double y)
Create a vector using the supplied x and y coordinates
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| double |
angleWith(Vector2D other)
Calculate angle with another vector
| ||||||||||
| double |
dot(Vector2D other)
Calculate dot product
| ||||||||||
| boolean |
equals(Object o)
| ||||||||||
| double |
getX()
Get the X coordinate
| ||||||||||
| double |
getY()
Get the Y coordinate
| ||||||||||
| int |
hashCode()
| ||||||||||
| Vector2D |
multiply(double scalar)
Multiply the vector with the given scalar
| ||||||||||
| Vector2D |
perpendicular()
Create a vector perpendicular to this vector
| ||||||||||
| String |
toString()
Return a human readable representation of this vector
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a vector using the supplied x and y coordinates
| x | X coordinate |
|---|---|
| y | Y coordinate |
Calculate angle with another vector
| other | the other vector |
|---|
Calculate dot product
| other | other vector |
|---|
Get the X coordinate
Get the Y coordinate
Multiply the vector with the given scalar
| scalar | scalar value |
|---|
Create a vector perpendicular to this vector
Return a human readable representation of this vector