Package org.opensourcephysics.display2d
Class SurfacePlotProjector
java.lang.Object
org.opensourcephysics.display2d.SurfacePlotProjector
The class
Projector
projects points in 3D space to 2D space.- Version:
- 1.71, 17 May 1997
- Author:
- Yanto Suryono
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the 2D x translation.int
Gets the 2D y translation.double
Gets the 2D scaling factor.double
Gets the cosine of elevation angle.double
Gets the cosine of rotation angle.double
Gets the projector distance.double
Gets current elevation angle.double
Gets current rotation angle.double
Gets the sine of elevation angle.double
Gets the sine of rotation angle.double
Gets the scaling factor in x direction.double
Gets the scaling factor in y direction.double
Gets the scaling factor in z direction.final Point
project
(double x, double y, double z) Projects 3D points.void
set2D_xTranslation
(int x) Sets the 2D x translation.void
set2D_yTranslation
(int y) Sets the 2D y translation.void
set2DScaling
(double scaling) Sets the 2D scaling factor.void
set2DTranslation
(int x, int y) Sets the 2D translation.void
setDistance
(double new_distance) Sets the projector distance.void
setElevationAngle
(double angle) Sets the elevation angle.void
Sets the projection area.void
setRotationAngle
(double angle) Sets the rotation angle.void
setScaling
(double scaling) Sets the same scaling factor for all direction.void
setScaling
(double x, double y, double z) Sets the scaling factor in all direction.void
setXScaling
(double scaling) Sets the scaling factor in x direction.void
setYScaling
(double scaling) Sets the scaling factor in y direction.void
setZScaling
(double scaling) Sets the scaling factor in z direction.
-
Method Details
-
setProjectionArea
Sets the projection area.- Parameters:
r
- the projection area
-
setRotationAngle
public void setRotationAngle(double angle) Sets the rotation angle.- Parameters:
angle
- the rotation angle in degrees
-
getRotationAngle
public double getRotationAngle()Gets current rotation angle.- Returns:
- the rotation angle in degrees.
-
getSinRotationAngle
public double getSinRotationAngle()Gets the sine of rotation angle.- Returns:
- the sine of rotation angle
-
getCosRotationAngle
public double getCosRotationAngle()Gets the cosine of rotation angle.- Returns:
- the cosine of rotation angle
-
setElevationAngle
public void setElevationAngle(double angle) Sets the elevation angle.- Parameters:
angle
- the elevation angle in degrees
-
getElevationAngle
public double getElevationAngle()Gets current elevation angle.- Returns:
- the elevation angle in degrees.
-
getSinElevationAngle
public double getSinElevationAngle()Gets the sine of elevation angle.- Returns:
- the sine of elevation angle
-
getCosElevationAngle
public double getCosElevationAngle()Gets the cosine of elevation angle.- Returns:
- the cosine of elevation angle
-
setDistance
public void setDistance(double new_distance) Sets the projector distance.- Parameters:
new_distance
- the new distance
-
getDistance
public double getDistance()Gets the projector distance.- Returns:
- the projector distance
-
setXScaling
public void setXScaling(double scaling) Sets the scaling factor in x direction.- Parameters:
scaling
- the scaling factor
-
getXScaling
public double getXScaling()Gets the scaling factor in x direction.- Returns:
- the scaling factor
-
setYScaling
public void setYScaling(double scaling) Sets the scaling factor in y direction.- Parameters:
scaling
- the scaling factor
-
getYScaling
public double getYScaling()Gets the scaling factor in y direction.- Returns:
- the scaling factor
-
setZScaling
public void setZScaling(double scaling) Sets the scaling factor in z direction.- Parameters:
scaling
- the scaling factor
-
getZScaling
public double getZScaling()Gets the scaling factor in z direction.- Returns:
- the scaling factor
-
setScaling
public void setScaling(double x, double y, double z) Sets the scaling factor in all direction.- Parameters:
x
- the scaling factor in x directiony
- the scaling factor in y directionz
- the scaling factor in z direction
-
setScaling
public void setScaling(double scaling) Sets the same scaling factor for all direction.- Parameters:
scaling
- the scaling factor
-
set2DScaling
public void set2DScaling(double scaling) Sets the 2D scaling factor.- Parameters:
scaling
- the scaling factor
-
get2DScaling
public double get2DScaling()Gets the 2D scaling factor.- Returns:
- the scaling factor
-
set2DTranslation
public void set2DTranslation(int x, int y) Sets the 2D translation.- Parameters:
x
- the x translationy
- the y translation
-
set2D_xTranslation
public void set2D_xTranslation(int x) Sets the 2D x translation.- Parameters:
x
- the x translation
-
get2D_xTranslation
public int get2D_xTranslation()Gets the 2D x translation.- Returns:
- the x translation
-
set2D_yTranslation
public void set2D_yTranslation(int y) Sets the 2D y translation.- Parameters:
y
- the y translation
-
get2D_yTranslation
public int get2D_yTranslation()Gets the 2D y translation.- Returns:
- the y translation
-
project
Projects 3D points.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinate
-