public class CoordinateConverter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static <any> |
CREATOR |
Constructor and Description |
---|
CoordinateConverter(Dimensions dimensions,
Coordinate center)
Define how cartesian area is placed in geographical space, aligned with east-west and north-south axis.
|
CoordinateConverter(Dimensions dimensions,
Coordinate center,
Angle rotation)
Define how the cartesian area is placed in geographical space, with a rotation with respect to east-west axis.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
Angle |
toAngle(Angle yaw)
Converts and angle from building system coordinate to Earth system coordinate.
|
CartesianCoordinate |
toCartesianCoordinate(Coordinate coordinate)
Transform geographical coordinates to cartesian coordinates (within the area defined in the constructor)
|
Coordinate |
toCoordinate(CartesianCoordinate fromCartesianCoordinate)
Transform cartesian coordinates (within the area defined in the constructor) into geographical coordinates
|
void |
writeToParcel(Parcel dest,
int flags) |
public CoordinateConverter(Dimensions dimensions, Coordinate center)
dimensions
- Not null. Dimensions of cartesian area, in meters. E.g. Building.getDimensions()
center
- Not null. Geographical coordinates of middle point of cartesian area. E.g. Building.getCenter()
public CoordinateConverter(Dimensions dimensions, Coordinate center, Angle rotation)
dimensions
- Not null. Dimensions of cartesian area, in meters. E.g. Building.getDimensions()
center
- Not null. Geographical coordinates of middle point of cartesian area. E.g. Building.getCenter()
rotation
- Not null. Rotation angle of the cartesian area, around the center point. E.g. Building.getRotation()
java.lang.IllegalArgumentException
- if some provided parameter is null.public Angle toAngle(Angle yaw)
yaw
- the angle to convertpublic CartesianCoordinate toCartesianCoordinate(Coordinate coordinate)
coordinate
- Not null.public Coordinate toCoordinate(CartesianCoordinate fromCartesianCoordinate)
fromCartesianCoordinate
- Not null.public int describeContents()
public void writeToParcel(Parcel dest, int flags)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object