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 TypeMethodDescriptionintGets the 2D x translation.intGets the 2D y translation.doubleGets the 2D scaling factor.doubleGets the cosine of elevation angle.doubleGets the cosine of rotation angle.doubleGets the projector distance.doubleGets current elevation angle.doubleGets current rotation angle.doubleGets the sine of elevation angle.doubleGets the sine of rotation angle.doubleGets the scaling factor in x direction.doubleGets the scaling factor in y direction.doubleGets the scaling factor in z direction.final Pointproject(double x, double y, double z) Projects 3D points.voidset2D_xTranslation(int x) Sets the 2D x translation.voidset2D_yTranslation(int y) Sets the 2D y translation.voidset2DScaling(double scaling) Sets the 2D scaling factor.voidset2DTranslation(int x, int y) Sets the 2D translation.voidsetDistance(double new_distance) Sets the projector distance.voidsetElevationAngle(double angle) Sets the elevation angle.voidSets the projection area.voidsetRotationAngle(double angle) Sets the rotation angle.voidsetScaling(double scaling) Sets the same scaling factor for all direction.voidsetScaling(double x, double y, double z) Sets the scaling factor in all direction.voidsetXScaling(double scaling) Sets the scaling factor in x direction.voidsetYScaling(double scaling) Sets the scaling factor in y direction.voidsetZScaling(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
-