v2x-client
| java.lang.Object | |
| ↳ | com.commsignia.v2x.utils.vectors.Point2D |
Represents a point in 2D space
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | EARTH_RADIUS | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Point2D(double x, double y)
Create a new point instance using the x and y parameter as coordinates
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Point2D |
add(Vector2D vector2D)
Translate the point by the given vector
| ||||||||||
| boolean |
equals(Object o)
| ||||||||||
| double |
getX()
Get the X coordinate
| ||||||||||
| double |
getY()
Get the Y coordinate
| ||||||||||
| int |
hashCode()
| ||||||||||
| double |
haversineDistance(Point2D other)
Calculate the haversine distance between this point and the specified point
| ||||||||||
| Vector2D |
minus(Point2D other)
Substract this point from another.
| ||||||||||
| String |
toString()
Return a friendly representation of this Point2D object.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a new point instance using the x and y parameter as coordinates
| x | X coordinate |
|---|---|
| y | Y coordinate |
Translate the point by the given vector
| vector2D | vector to use |
|---|
Get the X coordinate
Get the Y coordinate
Calculate the haversine distance between this point and the specified point
| other | the other point |
|---|
Substract this point from another. Essentially creates a vector from this point to the other point
| other | other point |
|---|
Return a friendly representation of this Point2D object.