net.aerith.misao.util
Class ChartMapFunction

java.lang.Object
  |
  +--net.aerith.misao.util.ChartMapFunction

public class ChartMapFunction
extends java.lang.Object

The ChartMapFunction represents functions to convert (x,y) position to R.A. and Decl. coordinates, and to convert R.A. and Decl. to (x,y) position. It consists of the R.A. and Decl. of the (0,0) position, the scale unit per 1 degree, and the position angle of the up direction.


Field Summary
protected  Coor center_coor
          The R.A.
protected  double position_angle
          The position angle of up direction.
protected  double scale_per_degree
          The scale unit per 1 degree.
 
Constructor Summary
ChartMapFunction(Coor initial_coor, double initial_scale, double initial_pa)
          Constructs a ChartMapFunction with the specified R.A.
 
Method Summary
 Coor getCenterCoor()
          Gets the R.A.
 double getPositionAngle()
          Gets the position angle of up direction.
 double getScaleUnitPerDegree()
          Gets the scale unit per 1 degree.
 ChartMapFunction map(MapFunction map_function)
          Maps the virtual chart of (x,y) positions represented by the R.A.
 Position mapCoordinatesToXY(Coordinates coor)
          Maps the specified R.A.
 Coor mapXYToCoordinates(Position position)
          Maps the specified (x,y) position to the R.A.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

center_coor

protected Coor center_coor
The R.A. and Decl. where (0,0) will be mapped.

scale_per_degree

protected double scale_per_degree
The scale unit per 1 degree.

position_angle

protected double position_angle
The position angle of up direction.
Constructor Detail

ChartMapFunction

public ChartMapFunction(Coor initial_coor,
                        double initial_scale,
                        double initial_pa)
Constructs a ChartMapFunction with the specified R.A. and Decl. of the (0,0) position, the scale unit per 1 degree, and the position angle of up direction.
Parameters:
initial_coor - the initial R.A. and Decl. of (0,0) position.
initial_scale - the initial scale unit per 1 degree.
initial_pa - the initial position angle of up direction.
Method Detail

getCenterCoor

public Coor getCenterCoor()
Gets the R.A. and Decl. of the center.
Returns:
the R.A. and Decl. of the center.

getScaleUnitPerDegree

public double getScaleUnitPerDegree()
Gets the scale unit per 1 degree.
Returns:
the scale unit per 1 degree.

getPositionAngle

public double getPositionAngle()
Gets the position angle of up direction.
Returns:
the position angle of up direction.

map

public ChartMapFunction map(MapFunction map_function)
Maps the virtual chart of (x,y) positions represented by the R.A. and Decl. of the center, the scale unit per 1 degree, and the position angle of up direction of this ChartMapFunction, to a new virtual chart of (x,y) positions by the specified MapFunction, and creates a new ChartMapFunction which represents the mapped chart.
Parameters:
map_function - the map function.
Returns:
the chart map function which consists of the R.A. and Decl. of the center, the scale unit per 1 degree, and the position angle of up direction on the mapped virtual chart.

mapCoordinatesToXY

public Position mapCoordinatesToXY(Coordinates coor)
Maps the specified R.A. and Decl. to the (x,y) position. The positive directions of (x,y) is to the right and down.
Parameters:
coor - the R.A. and Decl. to map.
Returns:
the mapped (x,y) position.

mapXYToCoordinates

public Coor mapXYToCoordinates(Position position)
Maps the specified (x,y) position to the R.A. and Decl. The positive directions of (x,y) must be to the right and down.
Parameters:
position - the (x,y) position to map.
Returns:
the mapped R.A. and Decl.