Interface: Crs

Crs

CRS is an interface to handle the coordinate reference system, which allows a Context :
  • to convert 3D position from/to world coordinates
  • to compute the local transformation matrix and vectors from this matrix
Mizar currently supports the following coordinates reference systems :
EquatorialCrs Provides an equatorial coordinate reference system
GalacticCrs Provides a galactic coordinate reference system
Mars2000Crs Provides a coordinate reference system base on the Mars geoide
WGS84Crs Provides a coordinate reference system base on the Earth geoide
ProjectedCrs Provides a projected coordinate reference system on a map
In addition to the classes, a factory is available to help for creating animation. Once the crs is created, the client can handle it by the use of its interface.
See:

Methods


isFlat()

Checks when the CRS is a ProjectedCrs. A ProjectedCrs projects data on a 2D map.
Returns:
True when the CRS is 2D otherwise False

getVerticalAt3D(pos, dest)

Computes the direction or vertical as a unit vector of the same direction as the provided pos.
Parameters:
Name Type Description
pos Array.<float> the position as a 3D vector
dest Array.<float> the direction as a 3D vector

fromGeoTo3D(geo, dest)

Converts a geographic position to a 3D vector.
Parameters:
Name Type Description
geo Array.<float> geographical position as a (longitude in degree, latitude in degree, distance from surface in meter)
dest Array.<float> 3D vector
Returns:
a 3D vector
Type
Array.<float>

from3DToGeo(position3d, dest)

Converts a 3D vector to geographical position.
Parameters:
Name Type Description
position3d Array.<float> 3D position
dest Array.<float> geographical position [long, lat, distance from earth surface]
Returns:
geographical position [long, lat, distance from earth surface]
Type
Array.<float>

getLocalTransform(geo, dest)

Returns the local transformation.
Parameters:
Name Type Description
geo Array.<float> geographical position
dest Array.<float> Matrix as 16 values
Returns:
Matrix as 16 values
Type
Array.<float>

getLHVTransform(geo, dest)

Returns the LHV transformation.
Parameters:
Name Type Description
geo Array.<float> geographical position
dest Array.<float> Matrix as 16 values
Returns:
Matrix as 16 values
Type
Array.<float>

getSideVector(matrix, v)

Returns the side (i.e. X) vector from a local transformation
Parameters:
Name Type Description
matrix Array.<float> Matrix as 16 values
v Array.<float> Vector as 3 values
Returns:
Vector as 3 values
Type
Array.<float>

getFrontVector(matrix, v)

Returns the front (i.e. Y) vector from a local transformation
Parameters:
Name Type Description
matrix Array.<float> Matrix as 16 values
v Array.<float> Vector as 3 values
Returns:
Vector as 3 values
Type
Array.<float>

getUpVector(matrix, v)

Returns the up (i.e. Z) vector from a local transformation
Parameters:
Name Type Description
matrix Array.<float> Matrix as 16 values
v Array.<float> Vector as 3 values
Returns:
Vector as 3 values
Type
Array.<float>

formatCoordinates(geo)

Formats the coordinates according to the coordinate reference system.
Parameters:
Name Type Description
geo Array.<string> position on the globe in decimal degree

getGeoide()

Returns the geoide.
Returns:
the geoide
Type
Geoide

getGeoideName()

Returns the geoide name.
Returns:
the geoide name
Type
string

getType()

Returns the name of the coordinate reference system.
Returns:
name of the coordinate reference system
Type
CRS

getElevation(globe, geoPos)

Returns the elevation in meters at a given position.
Parameters:
Name Type Description
globe AbstractGlobe globe
geoPos Array.<float> position on the globe in decimal degree
Returns:
the elevation in meters
Type
float

getWorldFrom3D(position3d, dest)

Returns the position in the defined CRS from a 3D position.
Parameters:
Name Type Description
position3d Array.<float> 3D position
dest Array.<float> the position in the defined coordinate reference system
Returns:
the position in the defined coordinate reference system
Type
Array.<float>

get3DFromWorld(posWorld, dest)

Returns the 3D position from the defined CRS.
Parameters:
Name Type Description
posWorld Array.<float> the position in the defined CRS
dest Array.<float> the 3D position
Returns:
the 3D position
Type
Array.<float>

get3DFromWorldInCrs(posWorld, posCrsID, dest)

Converts the 3D position from geo position in the current CRS to another CRS.
Parameters:
Name Type Description
posWorld Array.<float> geo position in the current coordinate reference system
posCrsID CRS ID of the target CRS
dest Array.<float> the 3D position
Returns:
the 3D position
Type
Array.<float>

getSexagesimalFromDeg(degPos, dest)

Returns the position in degree to sexagesimal format.
Parameters:
Name Type Description
degPos Array.<float> the geo position in decimal degree
dest Array.<string> the angle in sexagesimal format
Returns:
the angle in sexagesimal format
Type
Array.<string>

getDecimalDegFromSexagesimal(sexagesimalPos, dest)

Returns the geo position in decimal degree from sexagesimal format.
Parameters:
Name Type Description
sexagesimalPos Array.<string> sexagesimal geo position
dest Array.<float> the geo position in decimal degree
Returns:
the geo position in decimal degree
Type
Array.<float>

convert(geo, from, to)

Converts a position from a CRS to another CRS.
Parameters:
Name Type Description
geo Array.<float> geo position
from CRS the source CRS
to CRS the target CRS
Returns:
the position in the target CRS
Type
Array.<float>

fromDegreesToHMS(degree)

Converts an angle to HMS.
Parameters:
Name Type Description
degree an angle in decimal degree
Returns:
HMS
Type
string

fromDegreesToDMS(degree)

Converts an angle to DMS
Parameters:
Name Type Description
degree an angle in decimal degree
Returns:
DMS
Type
string

<protected> _setupPosBeforeTrans(posWorld)

Setups the position before the transformation. posWorld is changed.
Parameters:
Name Type Description
posWorld Array.<float>

<protected> _setupPosAfterTrans(posWorld)

Setups the position after the transformation. posWorld is changed.
Parameters:
Name Type Description
posWorld Array.<float>

getGeoBound()

Returns the geo bound of the given coordinate reference system
Returns:
the geo bound
Type
GeoBound