faa.tg.geometry
Class StereoMapProjection

java.lang.Object
  extended by faa.tg.geometry.MapProjection
      extended by faa.tg.geometry.StereoMapProjection
All Implemented Interfaces:
Locale, java.lang.Cloneable

public class StereoMapProjection
extends MapProjection
implements java.lang.Cloneable, Locale

 Stereographic projection information.  Provides xy-coordinate information
 (for a flat plane) for a point of tangency mapped to the Earth's surface.
 
See the source: StereoMapProjection.java

Version:
$Id: StereoMapProjection.java,v 3.7 2009/01/13 14:57:07 lonnies Exp $
Author:
Michael E. Ross
See Also:
faa.tg.geometry

Field Summary
private  double conformalLatCos
           
private  double conformalLatSin
           
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
(package private) static double D45
           
(package private) static double D90
           
static boolean DEBUG
           
private  Distance earthRadiusX2
           
private  double mapEccDiv2
           
private  Coefficient mapEccentricity
           
(package private) static double PI_DIV_2
           
private static double radiansPerDegDiv60
           
static double TOLERANCE
           
private  Distance xOffset
           
private  Distance yOffset
           
 
Fields inherited from class faa.tg.geometry.MapProjection
conformalLat, pointOfTangency, pointOfTangencyLatitude
 
Constructor Summary
StereoMapProjection(Ellipsoid el, Position pointOfTangency)
          Constructor for stereographic projection information.
StereoMapProjection(Ellipsoid el, Position pointOfTangency, Distance xOffset, Distance yOffset)
          Constructor for stereographic projection information
StereoMapProjection(PointOfTangencyData potData)
          Constructor for stereographic projection information using a PointOfTangencyData object and the default WGS84 ellipsoid.
StereoMapProjection(Position pointOfTangency)
          Constructor for stereographic projection information using center point offsets of zero and the default WGS84 ellipsoid.
StereoMapProjection(Position pointOfTangency, Coordinate offset)
           
StereoMapProjection(Position pointOfTangency, Distance xOffset, Distance yOffset)
          Constructor for stereographic projection information using the default WGS84 ellipsoid.
 
Method Summary
 Latitude calcConformalLat(Position pos)
          Calculates and returns the conformal latitude.
private  double conformalToGeoLat(double confLat)
          Convert conformal latitude to geodedic latitude.
 Distance getEarthRadiusX2()
           
 Latitude getLatitude()
           
 Longitude getLongitude()
           
 Coefficient getMapEccentricity()
           
 PointOfTangencyData getPointOfTangencyData()
          Creates a PointOfTangencyData object from the map projection fields.
 Distance getXOffset()
           
 Distance getYOffset()
           
 java.awt.geom.Point2D.Double latLonToXY(Position pos, DistanceUnits du)
          Converts a Position and a distance unit to xy coordinates.
 Coordinate latLonToXYCoordinate(Position pos)
          Converts a Position and a distance unit to Coordinate object.
static void main(java.lang.String[] args)
           
 java.lang.String toDraText()
          Return the stereographic projection point information as a String.
 java.lang.String toString()
          Return the stereographic projection point information in a short, descriptive String.
private  Position xyToLatLonStd(Distance xCoord, Distance yCoord, Altitude alt)
          Convert x/y to lat/lon - based on CMS CNVRT EXEC and comfirmed against code in NAS source module SCX task SCXE.
 Position xyToPosition(Coordinate coord, Altitude altitude)
          Converts xy coordinates to latitude/longitude delagating to xyToPosition(Coordinate coordinate, Altitude altitude).
 Position xyToPosition(Distance xCoord, Distance yCoord, Altitude alt)
          Converts xy coordinates to latitude/longitude using a locally developed approximation method.
 
Methods inherited from class faa.tg.geometry.MapProjection
getConformalLat, getPointOfTangency, getPointOfTangencyLatitude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values

TOLERANCE

public static final double TOLERANCE

mapEccentricity

private Coefficient mapEccentricity

mapEccDiv2

private double mapEccDiv2

earthRadiusX2

private Distance earthRadiusX2

xOffset

private Distance xOffset

yOffset

private Distance yOffset

D45

static double D45

D90

static double D90

conformalLatSin

private final double conformalLatSin

conformalLatCos

private final double conformalLatCos

PI_DIV_2

static final double PI_DIV_2
See Also:
Constant Field Values

radiansPerDegDiv60

private static final transient double radiansPerDegDiv60
Constructor Detail

StereoMapProjection

public StereoMapProjection(Ellipsoid el,
                           Position pointOfTangency)
Constructor for stereographic projection information.

Parameters:
el - The WGS84_Ellipsoid for this stereographic map projection.
pointOfTangency - The point of tangency for this stereo projection.

StereoMapProjection

public StereoMapProjection(Ellipsoid el,
                           Position pointOfTangency,
                           Distance xOffset,
                           Distance yOffset)
Constructor for stereographic projection information

Parameters:
el - The Ellipsoid for this stereographic map projection.
pointOfTangency - The point of tangency for this stereo projection.
xOffset - The x-coord offset of the Position from projection origin.
yOffset - The y-coord offset of the Position from projection origin.

StereoMapProjection

public StereoMapProjection(Position pointOfTangency,
                           Coordinate offset)

StereoMapProjection

public StereoMapProjection(Position pointOfTangency,
                           Distance xOffset,
                           Distance yOffset)
Constructor for stereographic projection information using the default WGS84 ellipsoid.

Parameters:
pointOfTangency - The point of tangency for this stereo projection.
xOffset - The x-coord offset of the Position from projection origin.
yOffset - The y-coord offset of the Position from projection origin.

StereoMapProjection

public StereoMapProjection(Position pointOfTangency)
Constructor for stereographic projection information using center point offsets of zero and the default WGS84 ellipsoid.

Parameters:
pointOfTangency - The point of tangency for this stereo projection.

StereoMapProjection

public StereoMapProjection(PointOfTangencyData potData)
Constructor for stereographic projection information using a PointOfTangencyData object and the default WGS84 ellipsoid.

Parameters:
potData - PointOfTangencyData for this stereo projection.
Method Detail

getPointOfTangencyData

public PointOfTangencyData getPointOfTangencyData()
Creates a PointOfTangencyData object from the map projection fields.


calcConformalLat

public Latitude calcConformalLat(Position pos)
Calculates and returns the conformal latitude.


getLatitude

public Latitude getLatitude()
Returns:
The latitude of the point of tangency.

getLongitude

public Longitude getLongitude()
Returns:
The latitude of the point of tangency.

getXOffset

public Distance getXOffset()
Returns:
The x-coordinate offset from the point of tangency.

getYOffset

public Distance getYOffset()
Returns:
The y-coordinate offset from the point of tangency.

latLonToXYCoordinate

public Coordinate latLonToXYCoordinate(Position pos)
Converts a Position and a distance unit to Coordinate object.

Specified by:
latLonToXYCoordinate in interface Locale

latLonToXY

public java.awt.geom.Point2D.Double latLonToXY(Position pos,
                                               DistanceUnits du)
Converts a Position and a distance unit to xy coordinates.

Specified by:
latLonToXY in class MapProjection

getMapEccentricity

public Coefficient getMapEccentricity()
Returns:
Returns the map eccentricity.

getEarthRadiusX2

public Distance getEarthRadiusX2()
Overrides:
getEarthRadiusX2 in class MapProjection
Returns:
Returns 2 times the earth radius to the tangency point.

xyToPosition

public Position xyToPosition(Coordinate coord,
                             Altitude altitude)
Converts xy coordinates to latitude/longitude delagating to xyToPosition(Coordinate coordinate, Altitude altitude).

Specified by:
xyToPosition in interface Locale
Parameters:
coord - Coordinate to get the Position for.
altitude - Altitude of the Position.
Returns:
Position corresponding to the x-y coordinates and Altitude.

xyToPosition

public Position xyToPosition(Distance xCoord,
                             Distance yCoord,
                             Altitude alt)
Converts xy coordinates to latitude/longitude using a locally developed approximation method. Rather than only using standard, reverse projection equations, this method begins with a lat/lon guess and then gets the x and y values of the Position created to see how close the resultant x/y is to the given "target" x/y. This is done iteratively, while refining the estimate each time until the result is within a specified tolerance. Original reverse-iterative estimation concept conceived by Dan Warburton.

Specified by:
xyToPosition in interface Locale
Specified by:
xyToPosition in class MapProjection
Parameters:
xCoord - X-coordinate to get the Position for.
yCoord - Y-coordinate to get the Position for.
alt - Altitude of the Position.
Returns:
Position corresponding to the x-y coordinates and Altitude.

xyToLatLonStd

private Position xyToLatLonStd(Distance xCoord,
                               Distance yCoord,
                               Altitude alt)
Convert x/y to lat/lon - based on CMS CNVRT EXEC and comfirmed against code in NAS source module SCX task SCXE.

Parameters:
xCoord - X-coordinate to get the Position for.
yCoord - Y-coordinate to get the Position for.
alt - Altitude of the Position.
Returns:
Position of the x-y coordinates and Altitude.

conformalToGeoLat

private double conformalToGeoLat(double confLat)
Convert conformal latitude to geodedic latitude.

Parameters:
confLat - The conformal latitude in radians.

toString

public java.lang.String toString()
Return the stereographic projection point information in a short, descriptive String.

Overrides:
toString in class java.lang.Object

toDraText

public java.lang.String toDraText()
Return the stereographic projection point information as a String.


main

public static void main(java.lang.String[] args)