Embedding<Euclidean3D,Euclidean2D>, Hyperplane<Euclidean3D>public class Plane extends Object implements Hyperplane<Euclidean3D>, Embedding<Euclidean3D,Euclidean2D>
| Constructor | Description |
|---|---|
Plane(Cartesian3D normal,
double tolerance) |
Build a plane normal to a given direction and containing the origin.
|
Plane(Cartesian3D p,
Cartesian3D normal,
double tolerance) |
Build a plane from a point and a normal.
|
Plane(Cartesian3D p1,
Cartesian3D p2,
Cartesian3D p3,
double tolerance) |
Build a plane from three points.
|
Plane(Plane plane) |
Copy constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
contains(Cartesian3D p) |
Check if the instance contains a point.
|
Plane |
copySelf() |
Copy the instance.
|
Cartesian3D |
getNormal() |
Get the normalized normal vector.
|
double |
getOffset(Plane plane) |
Get the offset (oriented distance) of a parallel plane.
|
double |
getOffset(Point<Euclidean3D> point) |
Get the offset (oriented distance) of a point.
|
Cartesian3D |
getOrigin() |
Get the origin point of the plane frame.
|
Cartesian3D |
getPointAt(Cartesian2D inPlane,
double offset) |
Get one point from the 3D-space.
|
double |
getTolerance() |
Get the tolerance below which points are considered to belong to the hyperplane.
|
Cartesian3D |
getU() |
Get the plane first canonical vector.
|
Cartesian3D |
getV() |
Get the plane second canonical vector.
|
Cartesian3D |
intersection(Line line) |
Get the intersection of a line with the instance.
|
Line |
intersection(Plane other) |
Build the line shared by the instance and another plane.
|
static Cartesian3D |
intersection(Plane plane1,
Plane plane2,
Plane plane3) |
Get the intersection point of three planes.
|
boolean |
isSimilarTo(Plane plane) |
Check if the instance is similar to another plane.
|
Point<Euclidean3D> |
project(Point<Euclidean3D> point) |
Project a point to the hyperplane.
|
void |
reset(Cartesian3D p,
Cartesian3D normal) |
Reset the instance as if built from a point and a normal.
|
void |
reset(Plane original) |
Reset the instance from another one.
|
void |
revertSelf() |
Revert the plane.
|
Plane |
rotate(Cartesian3D center,
Rotation rotation) |
Rotate the plane around the specified point.
|
boolean |
sameOrientationAs(Hyperplane<Euclidean3D> other) |
Check if the instance has the same orientation as another hyperplane.
|
Cartesian3D |
toSpace(Cartesian2D point) |
Transform an in-plane point into a 3D space point.
|
Cartesian3D |
toSpace(Point<Euclidean2D> point) |
Transform an in-plane point into a 3D space point.
|
Cartesian3D |
toSpace(Vector<Euclidean2D> vector) |
Transform a sub-space point into a space point.
|
Cartesian2D |
toSubSpace(Cartesian3D point) |
Transform a 3D space point into an in-plane point.
|
Cartesian2D |
toSubSpace(Point<Euclidean3D> point) |
Transform a 3D space point into an in-plane point.
|
Cartesian2D |
toSubSpace(Vector<Euclidean3D> vector) |
Transform a space vector into a sub-space vector.
|
Plane |
translate(Cartesian3D translation) |
Translate the plane by the specified amount.
|
SubPlane |
wholeHyperplane() |
Build a region covering the whole hyperplane.
|
PolyhedronsSet |
wholeSpace() |
Build a region covering the whole space.
|
public Plane(Cartesian3D normal, double tolerance) throws MathArithmeticException
normal - normal direction to the planetolerance - tolerance below which points are considered identicalMathArithmeticException - if the normal norm is too smallpublic Plane(Cartesian3D p, Cartesian3D normal, double tolerance) throws MathArithmeticException
p - point belonging to the planenormal - normal direction to the planetolerance - tolerance below which points are considered identicalMathArithmeticException - if the normal norm is too smallpublic Plane(Cartesian3D p1, Cartesian3D p2, Cartesian3D p3, double tolerance) throws MathArithmeticException
The plane is oriented in the direction of
(p2-p1) ^ (p3-p1)
p1 - first point belonging to the planep2 - second point belonging to the planep3 - third point belonging to the planetolerance - tolerance below which points are considered identicalMathArithmeticException - if the points do not constitute a planepublic Plane(Plane plane)
The instance created is completely independent of the original one. A deep copy is used, none of the underlying object are shared.
plane - plane to copypublic Plane copySelf()
The instance created is completely independant of the original one. A deep copy is used, none of the underlying objects are shared (except for immutable objects).
copySelf in interface Hyperplane<Euclidean3D>public void reset(Cartesian3D p, Cartesian3D normal) throws MathArithmeticException
p - point belonging to the planenormal - normal direction to the planeMathArithmeticException - if the normal norm is too smallpublic void reset(Plane original)
The updated instance is completely independant of the original one. A deep reset is used none of the underlying object is shared.
original - plane to reset frompublic Cartesian3D getOrigin()
The point returned is the orthogonal projection of the 3D-space origin in the plane.
public Cartesian3D getNormal()
public Cartesian3D getU()
The frame defined by (getU, getV,
getNormal) is a rigth-handed orthonormalized
frame).
getV(),
getNormal()public Cartesian3D getV()
The frame defined by (getU, getV,
getNormal) is a rigth-handed orthonormalized
frame).
getU(),
getNormal()public Point<Euclidean3D> project(Point<Euclidean3D> point)
project in interface Hyperplane<Euclidean3D>point - point to projectpublic double getTolerance()
getTolerance in interface Hyperplane<Euclidean3D>public void revertSelf()
Replace the instance by a similar plane with opposite orientation.
The new plane frame is chosen in such a way that a 3D point that had
(x, y) in-plane coordinates and z offset with
respect to the plane and is unaffected by the change will have
(y, x) in-plane coordinates and -z offset with
respect to the new plane. This means that the u and v
vectors returned by the getU() and getV() methods are exchanged,
and the w vector returned by the getNormal() method is
reversed.
public Cartesian2D toSubSpace(Vector<Euclidean3D> vector)
vector - n-dimension vector of the spacepublic Cartesian3D toSpace(Vector<Euclidean2D> vector)
vector - (n-1)-dimension point of the sub-spacepublic Cartesian2D toSubSpace(Point<Euclidean3D> point)
toSubSpace in interface Embedding<Euclidean3D,Euclidean2D>point - point of the space (must be a Cartesian3D instance)toSpace(org.apache.commons.math4.geometry.Vector<org.apache.commons.math4.geometry.euclidean.twod.Euclidean2D>)public Cartesian3D toSpace(Point<Euclidean2D> point)
toSpace in interface Embedding<Euclidean3D,Euclidean2D>point - in-plane point (must be a Cartesian2D instance)toSubSpace(org.apache.commons.math4.geometry.Vector<org.apache.commons.math4.geometry.euclidean.threed.Euclidean3D>)public Cartesian2D toSubSpace(Cartesian3D point)
point - point of the spacetoSpace(org.apache.commons.math4.geometry.Vector<org.apache.commons.math4.geometry.euclidean.twod.Euclidean2D>)public Cartesian3D toSpace(Cartesian2D point)
point - in-plane pointtoSubSpace(org.apache.commons.math4.geometry.Vector<org.apache.commons.math4.geometry.euclidean.threed.Euclidean3D>)public Cartesian3D getPointAt(Cartesian2D inPlane, double offset)
inPlane - desired in-plane coordinates for the point in the
planeoffset - desired offset for the pointpublic boolean isSimilarTo(Plane plane)
Planes are considered similar if they contain the same points. This does not mean they are equal since they can have opposite normals.
plane - plane to which the instance is comparedpublic Plane rotate(Cartesian3D center, Rotation rotation)
The instance is not modified, a new instance is created.
center - rotation centerrotation - vectorial rotation operatorpublic Plane translate(Cartesian3D translation)
The instance is not modified, a new instance is created.
translation - translation to applypublic Cartesian3D intersection(Line line)
line - line intersecting the instancepublic Line intersection(Plane other)
other - other planeLine instance)public static Cartesian3D intersection(Plane plane1, Plane plane2, Plane plane3)
plane1 - first plane1plane2 - second plane2plane3 - third plane2public SubPlane wholeHyperplane()
wholeHyperplane in interface Hyperplane<Euclidean3D>public PolyhedronsSet wholeSpace()
wholeSpace in interface Hyperplane<Euclidean3D>PolyhedronsSet instance)public boolean contains(Cartesian3D p)
p - point to checkpublic double getOffset(Plane plane)
This method should be called only for parallel planes otherwise the result is not meaningful.
The offset is 0 if both planes are the same, it is positive if the plane is on the plus side of the instance and negative if it is on the minus side, according to its natural orientation.
plane - plane to checkpublic double getOffset(Point<Euclidean3D> point)
The offset is 0 if the point is on the underlying hyperplane, it is positive if the point is on one particular side of the hyperplane, and it is negative if the point is on the other side, according to the hyperplane natural orientation.
getOffset in interface Hyperplane<Euclidean3D>point - point to checkpublic boolean sameOrientationAs(Hyperplane<Euclidean3D> other)
sameOrientationAs in interface Hyperplane<Euclidean3D>other - other hyperplane to check against the instanceCopyright © 2003–2017 The Apache Software Foundation. All rights reserved.