org.opensourcephysics.display2d
Class SurfacePlotProjector

java.lang.Object
  extended by org.opensourcephysics.display2d.SurfacePlotProjector

public final class SurfacePlotProjector
extends java.lang.Object

The class Projector projects points in 3D space to 2D space.

Version:
1.71, 17 May 1997
Author:
Yanto Suryono

Method Summary
 int get2D_xTranslation()
          Gets the 2D x translation.
 int get2D_yTranslation()
          Gets the 2D y translation.
 double get2DScaling()
          Gets the 2D scaling factor.
 double getCosElevationAngle()
          Gets the cosine of elevation angle.
 double getCosRotationAngle()
          Gets the cosine of rotation angle.
 double getDistance()
          Gets the projector distance.
 double getElevationAngle()
          Gets current elevation angle.
 double getRotationAngle()
          Gets current rotation angle.
 double getSinElevationAngle()
          Gets the sine of elevation angle.
 double getSinRotationAngle()
          Gets the sine of rotation angle.
 double getXScaling()
          Gets the scaling factor in x direction.
 double getYScaling()
          Gets the scaling factor in y direction.
 double getZScaling()
          Gets the scaling factor in z direction.
 java.awt.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 setProjectionArea(java.awt.Rectangle r)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setProjectionArea

public void setProjectionArea(java.awt.Rectangle r)
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 direction
y - the scaling factor in y direction
z - 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 translation
y - 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

public final java.awt.Point project(double x,
                                    double y,
                                    double z)
Projects 3D points.

Parameters:
x - the x coordinate
y - the y coordinate
z - the z coordinate