public class MapPos
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Constructor and Description |
---|
MapPos()
Constructs a MapPos object.
|
MapPos(double x,
double y)
Constructs a MapPos object from 2 coordinates.
|
MapPos(double x,
double y,
double z)
Constructs a MapPos object from 3 coordinates.
|
MapPos(long cPtr,
boolean cMemoryOwn) |
Modifier and Type | Method and Description |
---|---|
MapPos |
add(MapVec v)
Creates a new map position by adding a map vector to this map position.
|
void |
delete() |
double |
distanceFromLine(MapPos a,
MapPos b)
Calculates the distance between this map position and an infinte line defined by two points.
|
double |
distanceFromLineSegment(MapPos a,
MapPos b)
Calculates the distance between this map position and a line segment.
|
double |
distanceFromPoint(MapPos p)
Calculates the distance between this and another map position.
|
double |
distanceSqrFromLine(MapPos a,
MapPos b)
Calculates the square distance between this map position and an infinte line defined by two points.
|
double |
distanceSqrFromLineSegment(MapPos a,
MapPos b)
Calculates the square distance between this map position and a line segment.
|
double |
distanceSqrFromPoint(MapPos p)
Calculates the square distance between this and another map position.
|
boolean |
equals(java.lang.Object obj)
Checks if this object is equal to the specified object.
|
protected void |
finalize() |
static long |
getCPtr(MapPos obj) |
MapPos |
getRotated2D(double sin,
double cos)
Creates a new map position by rotating this map position around the z axis by an angle.
|
double |
getX()
Returns the x coordinate of this map position.
|
double |
getY()
Returns the y coordinate of this map position.
|
double |
getZ()
Returns the z coordinate of this map position.
|
int |
hashCode()
Returns the hash value of this object.
|
MapPos |
nearestPointOnLineSegment(MapPos a,
MapPos b)
Calculates the nearest point from this map position on a line segment.
|
MapVec |
subPos(MapPos p)
Creates a new map vector by subtracting a map position from this map position.
|
MapPos |
subVec(MapVec v)
Creates a new map position by subtracting a map vector from this map position.
|
java.lang.String |
toString()
Creates a string representation of this map position, useful for logging.
|
public MapPos(long cPtr, boolean cMemoryOwn)
public MapPos()
public MapPos(double x, double y)
x
- The x coordinate.y
- The y coordinate.public MapPos(double x, double y, double z)
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.public static long getCPtr(MapPos 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 MapPos add(MapVec v)
v
- The map vector to be added.public MapPos subVec(MapVec v)
v
- The map vector to be subtracted.public MapVec subPos(MapPos p)
p
- The map position to be subtracted.public double distanceFromPoint(MapPos p)
p
- The other map position.public double distanceSqrFromPoint(MapPos p)
p
- The other map position.public double distanceFromLine(MapPos a, MapPos b)
a
- Some point on the infinte line.b
- Another point on the infinite line.public double distanceSqrFromLine(MapPos a, MapPos b)
a
- Some point on the infinte line.b
- Another point on the infinite line.public double distanceFromLineSegment(MapPos a, MapPos b)
a
- Starting coordinate of the line segment.b
- Ending coordinate of the line segment.public double distanceSqrFromLineSegment(MapPos a, MapPos b)
a
- Starting coordinate of the line segment.b
- Ending coordinate of the line segment.public MapPos nearestPointOnLineSegment(MapPos a, MapPos b)
a
- Starting coordinate of the line segment.b
- Ending coordinate of the line segment.public MapPos getRotated2D(double sin, double cos)
sin
- The sine value of the rotation angle.cos
- The cosine value of the rotation angle.public java.lang.String toString()
toString
in class java.lang.Object