Package org.sm.smtools.math.quadmapping
Class QuadMapping
java.lang.Object
org.sm.smtools.math.quadmapping.QuadMapping
The
QuadMapping
class provides a perspective mapping for a convex quadrilateral.
This class maps 2D-data points between a convex quadrilateral and a normalised square:
Note: it is assumed that the X axis points to the right and the Y axis points upwards.
Note that this class cannot be subclassed!
- Version:
- 09/12/2004
- Author:
- Sven Maerivoet
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aQuadMapping
object based on the perspective mapping of the specified quadrilateral. -
Method Summary
Modifier and TypeMethodDescriptionmapQuadrilateralToSquare
(double x, double y) Inversely maps a 2D-data point in the quadrilateral to a 2D-data point in the normalised square.Inversely maps a 2D-data point in the quadrilateral to a 2D-data point in the normalised square.mapSquareToQuadrilateral
(double u, double v) Maps a 2D-data point in the normalised square to a 2D-data point in the quadrilateral.Maps a 2D-data point in the normalised square to a 2D-data point in the quadrilateral.void
Calculates the perspective mapping of the specified quadrilateral.
-
Constructor Details
-
QuadMapping
Constructs aQuadMapping
object based on the perspective mapping of the specified quadrilateral.- Parameters:
q
- the quadrilateral to use for the perspective mapping- See Also:
-
-
Method Details
-
setQuadrilateral
Calculates the perspective mapping of the specified quadrilateral.- Parameters:
q
- the quadrilateral to use for the perspective mapping
-
mapSquareToQuadrilateral
Maps a 2D-data point in the normalised square to a 2D-data point in the quadrilateral.- Parameters:
p
- the 2D-data point in the normalised square to map- Returns:
- the corresponding 2D-data point in the quadrilateral
- See Also:
-
mapSquareToQuadrilateral
Maps a 2D-data point in the normalised square to a 2D-data point in the quadrilateral.- Parameters:
u
- the x coordinate of the 2D-data point in the normalised square to mapv
- the y coordinate of the 2D-data point in the normalised square to map- Returns:
- the corresponding 2D-data point in the quadrilateral
- See Also:
-
mapQuadrilateralToSquare
Inversely maps a 2D-data point in the quadrilateral to a 2D-data point in the normalised square.- Parameters:
p
- the 2D-data point in the quadrilateral to map inversely- Returns:
- the corresponding 2D-data point in the normalised square
- See Also:
-
mapQuadrilateralToSquare
Inversely maps a 2D-data point in the quadrilateral to a 2D-data point in the normalised square.- Parameters:
x
- the x coordinate of the 2D-data point in the quadrilateral to map inverselyy
- the y coordinate of the 2D-data point in the quadrilateral to map inversely- Returns:
- the corresponding 2D-data point in the normalised square
- See Also:
-