|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.aerith.misao.util.MapFunction
The MapFunction
represents a function to convert (x,y)
position into (x',y') on another system. It consists of (x,y)
position on another system where the (0,0) position will be mapped,
the magnification ratio and the rotational angle.
The mapping calculation is:
(x', y') = r * R_angle (x, y) + (x0, y0)when r represents ratio, R_angle represents rotation by angle in the anti-clockwise direction when the positive directions of (x,y) are to the right and to the top, and (x0, y0) represents the position where the (0,0) will be mapped.
Field Summary | |
protected static double |
acceptable_angle
The acceptable accuracy of angle. |
protected static double |
acceptable_ratio
The acceptable accuracy of ratio. |
protected double |
angle
The rotational angle in the anti-clockwise direction. |
protected Position |
base_position
The position where (0,0) will be mapped. |
protected double |
ratio
The magnification ratio. |
Constructor Summary | |
MapFunction()
Constructs a default MapFunction , which maps onto
the same system. |
|
MapFunction(Triangle triangle1,
Triangle triangle2)
Constructs a MapFunction to map the specified
first triangle into the second triangle. |
|
MapFunction(java.util.Vector pair_list)
Constructs a MapFunction to map the first position
of the specified pair list into the second position of the
specified pair list. |
|
MapFunction(java.util.Vector pair_list,
DistortionField df)
Constructs a MapFunction to map the first position
of the specified pair list into the second position of the
specified pair list. |
Method Summary | |
double |
getAngle()
Gets the rotational angle. |
java.lang.String |
getOutputString()
Returns a string representation of the state of this object. |
double |
getRatio()
Gets the magnification ratio. |
MapFunction |
inverse()
Gets the inverse function of this map function. |
Position |
map(Position position)
Maps a position into the (x,y) on the another system. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected Position base_position
protected double ratio
protected double angle
protected static final double acceptable_ratio
protected static final double acceptable_angle
Constructor Detail |
public MapFunction()
MapFunction
, which maps onto
the same system.public MapFunction(java.util.Vector pair_list)
MapFunction
to map the first position
of the specified pair list into the second position of the
specified pair list.pair_list
- the list of pairs of (x,y) positions.public MapFunction(java.util.Vector pair_list, DistortionField df)
MapFunction
to map the first position
of the specified pair list into the second position of the
specified pair list.pair_list
- the list of pairs of (x,y) positions.df
- the distortion field.public MapFunction(Triangle triangle1, Triangle triangle2) throws java.lang.ArithmeticException
MapFunction
to map the specified
first triangle into the second triangle.triangle1
- the first triangle.triangle2
- the second triangle.Method Detail |
public Position map(Position position)
position
- the (x,y) on the source system.public MapFunction inverse()
public double getRatio()
public double getAngle()
public java.lang.String getOutputString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |