Class Plane
java.lang.Object
com.github.gbenroscience.math.geom.Plane
- Author:
- GBEMIRO
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a Plane object given the direction indices of its normal vector (stored in a gameMath.Point object)Creates the plane given 2 lines on it.Creates a Plane object given 3 points on it. -
Method Summary
Modifier and TypeMethodDescriptiondoubledoubledouble[]angleXY()double[]angleXZ()double[]angleYZ()booleanapproxEquals(double val1, double val2) Compares two numbers to see if they are close enough to be almost the same It checks if the values deviate by 1.0E-14 or lesser.booleanapproxEquals(double val1, double val2, double minDeviation) Compares two numbers to see if they are close enough to be almost the same It checks if the values deviate by 1.0E-14 or lesser.booleancontainsLine(Line3D lin) booleancontainsPoint(Point point) doubledoublegetX(double y, double z) doublegetY(double x, double z) doublegetZ(double x, double y) intersectionWith(Line3D line) intersectionWith(Plane plane) static voidvoidsetDirectionIndices(Direction directionIndices) voidsetPlaneConstant(double planeConstant) toString()
-
Constructor Details
-
Plane
-
Plane
Creates a Plane object given the direction indices of its normal vector (stored in a gameMath.Point object)- Parameters:
directionIndices- the direction indices of its normal vectorplaneConstant- the constant of the plane.
-
Plane
-
Plane
-
Plane
-
-
Method Details
-
getDirectionIndices
- Returns:
- this Plane object's Direction attribute.
-
setDirectionIndices
- Parameters:
directionIndices- sets this Plane object's Direction attribute
-
getPlaneConstant
public double getPlaneConstant()- Returns:
- the constant attribute of this Plane object
-
setPlaneConstant
public void setPlaneConstant(double planeConstant) - Parameters:
planeConstant- sets the constant attribute of this Plane object
-
angleXY
public double[] angleXY()- Returns:
- the angle between this Plane object and the XY plane as an Array object of 2 double values.
-
angleXZ
public double[] angleXZ()- Returns:
- the angle between this Plane object and the XZ plane as an Array object of 2 double values.
-
angleYZ
public double[] angleYZ()- Returns:
- the angle between this Plane object and the YZ plane as an Array object of 2 double values.
-
angle
- Parameters:
plane- The angle this Plane object makes with another Plane object.- Returns:
- the angle between the 2 Plane objects.
-
angle
- Parameters:
line- the Line3D object whose angle with this Plane object is desired.- Returns:
- the angle between this Plane object and the Line3D object passed as a parameter to this method
-
getZ
public double getZ(double x, double y) - Parameters:
x- the x coordinate of a Point object on this Plane object.y- the y coordinate of a Point object on this Plane object.- Returns:
- the z coordinate of that Point object.
-
getY
public double getY(double x, double z) - Parameters:
x- the x coordinate of a Point object on this Plane object.z- the z coordinate of a Point object on this Plane object.- Returns:
- the y coordinate of that Point object.
-
getX
public double getX(double y, double z) - Parameters:
y- the y coordinate of a Point object on this Plane object.z- the z coordinate of a Point object on this Plane object.- Returns:
- the x coordinate of that Point object.
-
containsPoint
- Parameters:
point- The Point object in consideration- Returns:
- true if the Point object lies on this Plane object.
-
containsLine
- Parameters:
lin- the Line3D object.- Returns:
- true if the Line3D object lies on this Plane object.
-
intersectionWith
-
intersectionWith
-
toString
-
approxEquals
public boolean approxEquals(double val1, double val2) Compares two numbers to see if they are close enough to be almost the same It checks if the values deviate by 1.0E-14 or lesser.- Parameters:
val1- the first value to compareval2- the second value to compare- Returns:
- true if the values deviate by 1.0E-14 or lesser.
-
approxEquals
public boolean approxEquals(double val1, double val2, double minDeviation) Compares two numbers to see if they are close enough to be almost the same It checks if the values deviate by 1.0E-14 or lesser.- Parameters:
val1- the first value to compareval2- the second value to compareminDeviation- the minimum difference they must have to be acceptably equal.- Returns:
- true if the values deviate by 1.0E-14 or lesser.
-
main
-