Package org.sm.smtools.math.quadmapping
Class QuadToQuadMapping
java.lang.Object
org.sm.smtools.math.quadmapping.QuadToQuadMapping
The
QuadToQuadMapping
class provides a perspective mapping between two convex quadrilaterals.
This class maps 2D-data points between two convex quadrilaterals:
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
ConstructorsConstructorDescriptionQuadToQuadMapping
(QuadMapping quad1Mapping, QuadMapping quad2Mapping) Constructs aQuadToQuadMapping
object based on the two perspective mappings between quadrilaterals.Constructs aQuadToQuadMapping
object based on the two specified quadrilaterals. -
Method Summary
Modifier and TypeMethodDescriptionmapQuad1ToQuad2
(double x, double y) Maps a 2D-data point in the first quadrilateral to a 2D-data point in the second quadrilateral.Maps a 2D-datapoint in the first quadrilateral to a 2D-data point in the second quadrilateral.mapQuad2ToQuad1
(double x, double y) Maps a 2D-data point in the second quadrilateral to a 2D-data point in the first quadrilateral.Maps a 2D-data point in the second quadrilateral to a 2D-data point in the first quadrilateral.void
set
(QuadMapping quad1Mapping, QuadMapping quad2Mapping) Sets the perspective mapping based on the two perspective mappings between quadrilaterals.
-
Constructor Details
-
QuadToQuadMapping
Constructs aQuadToQuadMapping
object based on the two perspective mappings between quadrilaterals.- Parameters:
quad1Mapping
- the first perspective mapping to usequad2Mapping
- the second perspective mapping to use- See Also:
-
QuadToQuadMapping
Constructs aQuadToQuadMapping
object based on the two specified quadrilaterals.- Parameters:
q1
- the first quadrilateral to use for the perspective mappingq2
- the second quadrilateral to use for the perspective mapping- See Also:
-
-
Method Details
-
set
Sets the perspective mapping based on the two perspective mappings between quadrilaterals.- Parameters:
quad1Mapping
- the first perspective mapping to usequad2Mapping
- the second perspective mapping to use
-
mapQuad1ToQuad2
Maps a 2D-datapoint in the first quadrilateral to a 2D-data point in the second quadrilateral.- Parameters:
p
- the 2D-data point in the first quadrilateral- Returns:
- the corresponding 2D-data point in the second quadrilateral
-
mapQuad1ToQuad2
Maps a 2D-data point in the first quadrilateral to a 2D-data point in the second quadrilateral.- Parameters:
x
- the x coordinate of the 2D-data point in the first quadrilateraly
- the y coordinate of the 2D-data point in the first quadrilateral- Returns:
- the corresponding 2D-data point in the second quadrilateral
-
mapQuad2ToQuad1
Maps a 2D-data point in the second quadrilateral to a 2D-data point in the first quadrilateral.- Parameters:
p
- the 2D-data point in the second quadrilateral- Returns:
- the corresponding 2D-data point in the first quadrilateral
-
mapQuad2ToQuad1
Maps a 2D-data point in the second quadrilateral to a 2D-data point in the first quadrilateral.- Parameters:
x
- the x coordinate of the 2D-data point in the second quadrilateraly
- the y coordinate of the 2D-data point in the second quadrilateral- Returns:
- the corresponding 2D-data point in the first quadrilateral
-