| java.lang.Object | |
| ↳ | com.carto.core.MapVec |
A double precision map vector defined by 3 coordinates.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
MapVec()
Constructs a MapVec object.
| |||||||||||
|
MapVec(double x, double y)
Constructs a MapVec object from 2 coordinates.
| |||||||||||
|
MapVec(double x, double y, double z)
Constructs a MapVec object from 3 coordinates.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| MapVec |
add(MapVec v)
Creates a new map vector by adding a map vector to this map vector.
| ||||||||||
| double |
crossProduct2D(MapVec v)
Calculates the 2D cross product between this and another map vector.
| ||||||||||
| MapVec |
crossProduct3D(MapVec v)
Creates a new map vector that's perpendicular to the plane defined by this and another map vector.
| ||||||||||
| synchronized void | delete() | ||||||||||
| MapVec |
div(double divider)
Creates a new map vector by dividing this map vector with a divider.
| ||||||||||
| double |
dotProduct(MapVec v)
Calculates the dot product between this and another map vector.
| ||||||||||
| boolean |
equals(Object obj)
Checks if this object is equal to the specified object.
| ||||||||||
| MapVec |
getNormalized()
Creates a new map vector by normalizing this map vector.
| ||||||||||
| double |
getX()
Returns the x coordinate of this map vector.
| ||||||||||
| double |
getY()
Returns the y coordinate of this map vector.
| ||||||||||
| double |
getZ()
Returns the z coordinate of this map vector.
| ||||||||||
| int |
hashCode()
Returns the hash value of this object.
| ||||||||||
| double |
length()
Calculates the length of this map vector.
| ||||||||||
| MapVec |
mul(double multiplier)
Creates a new map vector by multiplying this map vector with a multiplier.
| ||||||||||
| MapVec |
sub(MapVec v)
Creates a new map vector by subtracting a map vector from this map vector.
| ||||||||||
| String |
toString()
Creates a string representation of this map vector, useful for logging.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Constructs a MapVec object. All coordinates will be 0.
Constructs a MapVec object from 2 coordinates. The z coordinate will be 0.
| x | The x coordinate. |
|---|---|
| y | The y coordinate. |
Constructs a MapVec object from 3 coordinates.
| x | The x coordinate. |
|---|---|
| y | The y coordinate. |
| z | The z coordinate. |
Creates a new map vector by adding a map vector to this map vector.
| v | The map vector to be added. |
|---|
Calculates the 2D cross product between this and another map vector. Defined as x1 * y2 - y1 * x2.
| v | The other map vector. |
|---|
Creates a new map vector that's perpendicular to the plane defined by this and another map vector.
| v | The other map vector. |
|---|
Creates a new map vector by dividing this map vector with a divider.
| divider | The divider. |
|---|
Calculates the dot product between this and another map vector.
| v | The other map vector. |
|---|
Checks if this object is equal to the specified object.
| obj | The reference object. |
|---|
Creates a new map vector by normalizing this map vector.
Returns the x coordinate of this map vector.
Returns the y coordinate of this map vector.
Returns the z coordinate of this map vector.
Returns the hash value of this object.
Calculates the length of this map vector.
Creates a new map vector by multiplying this map vector with a multiplier.
| multiplier | The multiplier. |
|---|
Creates a new map vector by subtracting a map vector from this map vector.
| v | The map vector to be subtracted. |
|---|
Creates a string representation of this map vector, useful for logging.