public class Plane3 extends Object implements EuclidConstants
A plane is described by a unit vector (vector) and the perpendicular distance (dist) of the plane from the origin. The absolute direction of the plane (vector) IS important, giving the plane a direction (back and front faces).
The default plane is a Vector of (0.0, 0.0, 0.0) and a distance of 0.0. Operations on this default may lead to Exceptions such as ZeroLengthvector.
| Modifier and Type | Field and Description |
|---|---|
protected double |
dist
distance of plane from origin
|
protected Vector3 |
vect
vector of plane (normalised)
|
C_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Constructor and Description |
|---|
Plane3()
default constructor.
|
Plane3(double[] array)
construct from array.
|
Plane3(double[] lmn,
double d)
formed from components.
|
Plane3(double l,
double m,
double n,
double d)
formed from components.
|
Plane3(Line3 l,
Point3 p)
make a plane from a line and a point not on the line.
|
Plane3(Plane3 pl)
copy constructor:
|
Plane3(Point3 p1,
Point3 p2,
Point3 p3)
make a plane from three points.
|
Plane3(Vector3 v,
double d)
formed from plane and distance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsPoint(Point3 p)
is a point on the plane.
|
Angle |
getAngleMadeWith(Plane3 pl2)
the angle between 2 planes.
|
double[] |
getArray()
get return contents as an array.
|
Point3 |
getClosestPointTo(Point3 p2)
point on plane closest to another point.
|
double |
getDistance()
get distance from origin.
|
double |
getDistanceFromPoint(Point3 p)
distance of point from plane.
|
Point3 |
getIntersectionWith(Line3 l)
point of intersection of plane and line.
|
Line3 |
getIntersectionWith(Plane3 pl2)
get line as intersection of two planes.
|
Point3 |
getIntersectionWith(Plane3 pl2,
Plane3 pl3)
point where three planes intersect
|
Vector3 |
getVector()
get vector.
|
boolean |
isAntiparallelTo(Plane3 pl2)
are two planes antiparallel.
|
boolean |
isEqualTo(Plane3 pl2)
are two planes coincident and parallel.
|
boolean |
isParallelTo(Plane3 pl2)
are two planes parallel.
|
void |
negative()
reverse direction of plane.
|
Plane3 |
subtract()
form coincident antiparallel plane.
|
String |
toString()
string representation.
|
protected Vector3 vect
protected double dist
public Plane3()
public Plane3(double l,
double m,
double n,
double d)
throws EuclidRuntimeException
l - componentm - componentn - componentd - distanceEuclidRuntimeExceptionpublic Plane3(double[] lmn,
double d)
throws EuclidRuntimeException
lmn - componentd - distanceEuclidRuntimeExceptionpublic Plane3(double[] array)
throws EuclidRuntimeException
array - 4-componentsEuclidRuntimeExceptionpublic Plane3(Vector3 v, double d) throws EuclidRuntimeException
v - vectord - distanceEuclidRuntimeExceptionpublic Plane3(Plane3 pl)
pl - placepublic Plane3(Point3 p1, Point3 p2, Point3 p3) throws EuclidRuntimeException
p1 - pointp2 - pointp3 - pointEuclidRuntimeExceptionpublic Plane3(Line3 l, Point3 p) throws EuclidRuntimeException
l - pointp - pointEuclidRuntimeExceptionpublic double[] getArray()
public Vector3 getVector()
public double getDistance()
public void negative()
public boolean isEqualTo(Plane3 pl2)
pl2 - plane to comparepublic Plane3 subtract()
public double getDistanceFromPoint(Point3 p)
p - the pointpublic boolean isParallelTo(Plane3 pl2)
pl2 - the planepublic boolean isAntiparallelTo(Plane3 pl2)
pl2 - the planepublic boolean containsPoint(Point3 p)
p - the pointpublic Point3 getClosestPointTo(Point3 p2)
p2 - other pointpublic Point3 getIntersectionWith(Line3 l)
l - linepublic Line3 getIntersectionWith(Plane3 pl2)
pl2 - planepublic Point3 getIntersectionWith(Plane3 pl2, Plane3 pl3)
pl2 - planepl3 - planepublic Angle getAngleMadeWith(Plane3 pl2)
pl2 - planeCopyright © 1994–2024 Peter Murray-Rust. All rights reserved.