|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.algart.drawing3d.CoordinateSystem3D
public final class CoordinateSystem3D extends java.lang.Object implements java.lang.Cloneable
Coordinate system in 3D space. Formally, it is a triplet of orthogonal vectors, named the basis,
having the same length, named the scale σ, and originating in 3D space from the same point,
named the origin
The base vectors, divided by the scale σ, are named the orientation
and represented by Orientation3D
class: the triplet of orthonormal vectors
The coordinates of the origin O, the scale σ and
the orientation
The main goal of this class is transforming coordinates of some point from this coordinate system to the simple coordinates and vice versa. Formally, this class defines:
The direct transform is performed by
transformX(double, double, double)
,transformY(double, double, double)
,transformZ(double, double, double)
methods, the inverse transform is performed by
inverseTransformX(double, double, double)
,inverseTransformY(double, double, double)
,inverseTransformZ(double, double, double)
methods.
This class is not thread-safe, but is thread-compatible and can be synchronized manually if multithread access is necessary.
AlgART Laboratory 2010
Constructor and Description |
---|
CoordinateSystem3D()
Creates the trivial coordinate system: O=0=(0,0,0), σ=1.0, i vector is (1,0,0), j vector is (0,1,0), k vector is (0,0,1). |
CoordinateSystem3D(double originX,
double originY,
double originZ,
double scale,
Orientation3D orientation)
Creates new coordinate system, fully specified by the arguments of the constructor. |
Modifier and Type | Method and Description |
---|---|
CoordinateSystem3D |
clone()
Returns the precise clone of this coordinate system. |
Orientation3D |
getOrientation()
Returns the orientation: the orthonormal basis |
double |
getOriginX()
Returns x-coordinate of the origin Ox. |
double |
getOriginY()
Returns y-coordinate of the origin Oy. |
double |
getOriginZ()
Returns z-coordinate of the origin Oz. |
double |
getScale()
Returns the scale σ. |
double |
inverseTransformX(double x,
double y,
double z)
Returns the x-coordinate of the given point in terms of this coordinate system. |
double |
inverseTransformY(double x,
double y,
double z)
Returns the y-coordinate of the given point in terms of this coordinate system. |
double |
inverseTransformZ(double x,
double y,
double z)
Returns the z-coordinate of the given point in terms of this coordinate system. |
void |
setOrientation(Orientation3D orientation)
Sets the new orientation: the orthonormal basis |
void |
setOrigin(double originX,
double originY,
double originZ)
Sets the new origin O. |
void |
setScale(double scale)
Sets the scale σ. |
java.lang.String |
toString()
Returns a brief string description of this object. |
double |
transformX(double x,
double y,
double z)
Returns the x-coordinate of the point, which has the given coordinates in terms of this coordinate system. |
double |
transformY(double x,
double y,
double z)
Returns the y-coordinate of the point, which has the given coordinates in terms of this coordinate system. |
double |
transformZ(double x,
double y,
double z)
Returns the z-coordinate of the point, which has the given coordinates in terms of this coordinate system. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CoordinateSystem3D()
public CoordinateSystem3D(double originX, double originY, double originZ, double scale, Orientation3D orientation)
originX
- x-coordinate of the origin Ox.originY
- y-coordinate of the origin Oy.originZ
- z-coordinate of the origin Oz.scale
- the scale σ.orientation
- the orientation java.lang.NullPointerException
- if orientation argument if null.java.lang.IllegalArgumentException
- if scale<=0.0.Method Detail |
---|
public double getOriginX()
public double getOriginY()
public double getOriginZ()
public void setOrigin(double originX, double originY, double originZ)
originX
- x-coordinate of the new origin Ox.originY
- y-coordinate of the new origin Oy.originZ
- z-coordinate of the new origin Oz.public double getScale()
public void setScale(double scale)
scale
- the new scale σ.java.lang.IllegalArgumentException
- if scale<=0.0.public Orientation3D getOrientation()
public void setOrientation(Orientation3D orientation)
orientation
- the new orientation.public double transformX(double x, double y, double z)
x
- the x-coordinate in terms of the coordinate system, represented by this class.y
- the y-coordinate in terms of the coordinate system, represented by this class.z
- the z-coordinate in terms of the coordinate system, represented by this class.public double transformY(double x, double y, double z)
x
- the x-coordinate in terms of the coordinate system, represented by this class.y
- the y-coordinate in terms of the coordinate system, represented by this class.z
- the z-coordinate in terms of the coordinate system, represented by this class.public double transformZ(double x, double y, double z)
x
- the x-coordinate in terms of the coordinate system, represented by this class.y
- the y-coordinate in terms of the coordinate system, represented by this class.z
- the z-coordinate in terms of the coordinate system, represented by this class.public double inverseTransformX(double x, double y, double z)
x
- the x-coordinate of some point.y
- the y-coordinate of some point.z
- the z-coordinate of some point.public double inverseTransformY(double x, double y, double z)
x
- the x-coordinate of some point.y
- the y-coordinate of some point.z
- the z-coordinate of some point.public double inverseTransformZ(double x, double y, double z)
x
- the x-coordinate of some point.y
- the y-coordinate of some point.z
- the z-coordinate of some point.public CoordinateSystem3D clone()
clone
in class java.lang.Object
public java.lang.String toString()
The result of this method may depend on implementation.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |