java.lang.Object
org.jfree.chart3d.graphics3d.Rotate3D
- All Implemented Interfaces:
Serializable
Performs rotations about along an arbitrary axis (defined by two
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
Point3D instances). This file is derived from code published in
"Computer Graphics for Java Programmers (Second Edition)" by Leen Ammeraal
and Kang Zhang.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyRotation(double x, double y, double z) Creates an returns a new point that is the rotation of the point(x, y, z)about the axis that was specified via the constructor.double[]applyRotation(double x, double y, double z, double[] result) Returns the coordinates of a point that is the rotation of the point(x, y, z)about the axis that was specified via the constructor.Creates and returns a new point that is the rotation ofpabout the axis that was specified via the constructor.doublegetAngle()Returns the angle of rotation, in radians.voidsetAngle(double angle) Sets the angle of rotation (in radians) and (internally) updates the values of the transformation matrix ready for the next call(s) to theapplyRotationmethods.
-
Constructor Details
-
Rotate3D
Creates a new instance that will rotate points about the axis passing through points a and b, by the specified angle.- Parameters:
a- the first point defining the axis of rotation (nullnot permitted).b- the second point defining the axis of rotation (nullnot permitted).angle- the rotation angle (in radians).
-
-
Method Details
-
getAngle
Returns the angle of rotation, in radians.- Returns:
- The angle of rotation, in radians.
-
setAngle
Sets the angle of rotation (in radians) and (internally) updates the values of the transformation matrix ready for the next call(s) to theapplyRotationmethods.- Parameters:
angle- the angle (in radians).
-
applyRotation
Creates and returns a new point that is the rotation ofpabout the axis that was specified via the constructor.- Parameters:
p- the point (nullnot permitted).- Returns:
- A new point.
-
applyRotation
Creates an returns a new point that is the rotation of the point(x, y, z)about the axis that was specified via the constructor.- Parameters:
x- the x-coordinate of the point to transform.y- the y-coordinate of the point to transform.z- the z-coordinate of the point to transform.- Returns:
- The transformed point (never
null).
-
applyRotation
Returns the coordinates of a point that is the rotation of the point(x, y, z)about the axis that was specified via the constructor.- Parameters:
x- the x-coordinate of the point to transform.y- the y-coordinate of the point to transform.z- the z-coordinate of the point to transform.result- an array to carry the result (nullpermitted).- Returns:
- The transformed coordinates (in the
resultarray if one was supplied, otherwise in a newly allocated array).
-