public class MapVec
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Constructor and Description |
---|
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.
|
MapVec(long cPtr,
boolean cMemoryOwn) |
Modifier and Type | Method and Description |
---|---|
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.
|
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(java.lang.Object obj)
Checks if this object is equal to the specified object.
|
protected void |
finalize() |
static long |
getCPtr(MapVec obj) |
MapVec |
getNormalized()
Creates a new map vector by normalizing this map vector.
|
MapVec |
getRotated2D(double sin,
double cos)
Creates a new map vector by rotating this map vector around it's back end and around z axis.
|
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.
|
java.lang.String |
toString()
Creates a string representation of this map vector, useful for logging.
|
public MapVec(long cPtr, boolean cMemoryOwn)
public MapVec()
public MapVec(double x, double y)
x
- The x coordinate.y
- The y coordinate.public MapVec(double x, double y, double z)
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.public static long getCPtr(MapVec obj)
protected void finalize()
finalize
in class java.lang.Object
public void delete()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public double getX()
public double getY()
public double getZ()
public MapVec add(MapVec v)
v
- The map vector to be added.public MapVec sub(MapVec v)
v
- The map vector to be subtracted.public MapVec mul(double multiplier)
multiplier
- The multiplier.public MapVec div(double divider)
divider
- The divider.public double length()
public MapVec getNormalized()
public MapVec getRotated2D(double sin, double cos)
sin
- The sine value of the rotation angle.cos
- The cosine value of the rotation angle.public double crossProduct2D(MapVec v)
v
- The other map vector.public MapVec crossProduct3D(MapVec v)
v
- The other map vector.public double dotProduct(MapVec v)
v
- The other map vector.public java.lang.String toString()
toString
in class java.lang.Object