edu.nrao.sss.geom
Class AzimuthalEquidistantProjector

java.lang.Object
  extended by edu.nrao.sss.geom.AzimuthalEquidistantProjector

public class AzimuthalEquidistantProjector
extends Object

A coordinate transformer that maps a point on a sphere to a point on a plane using an azimuthal equidistant projection. This projection is such that the relative distances from a point at the center of the plane to other points elsewhere on the plane are accurate in their ratios to one another. This makes it a useful projection for comparing relative distances from a fixed point.

The algorithms used in this class were taken from:

Weisstein, Eric W, "Azimuthal Equidistant Projection", from MathWorld--A Wolfram Web Resource.

Version Info:

$Revision: 1239 $
$Date: 2008-04-25 10:34:57 -0600 (Fri, 25 Apr 2008) $
$Author: dharland $ (last person to modify)

Since:
2007-06-07
Author:
David M. Harland

Constructor Summary
AzimuthalEquidistantProjector()
          Creates a new instance.
 
Method Summary
 SphericalPosition getLatLonFor(Point2D xyPosition)
          Performs the inverse projection of an x,y point on a plane to a longitude, latitude position on a sphere.
 Point2D getXyFor(SphericalPosition sphericalPosition)
          Projects the longitude, latitude position on a sphere into an x,y position on a plane.
 AffineTransform getXyTransformer()
          Returns the 2D-to-2D planar transformer used by this projector.
 void setCenter(SphericalPosition centerPosition)
          Sets the center point, in longitude and latitude, for this projector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AzimuthalEquidistantProjector

public AzimuthalEquidistantProjector()
Creates a new instance.

Method Detail

setCenter

public final void setCenter(SphericalPosition centerPosition)
Sets the center point, in longitude and latitude, for this projector.

Parameters:
centerPosition - the center point, in longitude and latitude, for this projector.

getXyTransformer

public AffineTransform getXyTransformer()
Returns the 2D-to-2D planar transformer used by this projector. This transformer is initially created as an identity transformer. The returned transformer is a reference to the one held by this projector, so changes made to it are reflected herein.

This projector turns a longitude or latitude of ninety degrees into an x or y value of one-half pi. By properly configuring the returned transformer, you can change this projector's center coordinate and x and y ranges to other values.

Returns:
the affine transform used by this projector to transform the x,y coordinates it produces into x',y' coordinates.

getXyFor

public Point2D getXyFor(SphericalPosition sphericalPosition)
Projects the longitude, latitude position on a sphere into an x,y position on a plane. The returned value is first run through an azimuthal equidistant projection, and then through an affine transform that may be configured by clients.

Parameters:
sphericalPosition - a longitude, latitude coordinate pair on a sphere. (The distance attribute is ignored.)
Returns:
an x,y point on a plane created by an azimuthal equidistant projection from the given position on a sphere.

getLatLonFor

public SphericalPosition getLatLonFor(Point2D xyPosition)
                               throws NoninvertibleTransformException
Performs the inverse projection of an x,y point on a plane to a longitude, latitude position on a sphere. The x,y point is first run through the inverse of an affine transform that may be configured by clients. It is then run through the inverse of an azimuthal equidistant projection.

Parameters:
xyPosition - an x,y position on a plane.
Returns:
a longitude, latitude position on a sphere created by an inverse azimuthal equidistant projection from the given position on a plane.
Throws:
NoninvertibleTransformException


Copyright © 2009. All Rights Reserved.