## toxi.geom Class Plane

```java.lang.Object
toxi.geom.Vec3D
toxi.geom.Plane
```
All Implemented Interfaces:

`public class Planeextends Vec3Dimplements Shape3D`

Class to describe and work with infinite generic 3D planes. Useful for intersection problems and classifying points.

Nested Class Summary
`static class` `Plane.Classifier`
Classifier constant for `classifyPoint(ReadonlyVec3D, float)`

Nested classes/interfaces inherited from class toxi.geom.Vec3D
`Vec3D.Axis`

Field Summary
` Vec3D` `normal`

`static Plane` `XY`

`static Plane` `XZ`

`static Plane` `YZ`

Fields inherited from class toxi.geom.Vec3D
`MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, z, Z_AXIS, ZERO`

Constructor Summary
`Plane()`

`Plane(Triangle3D t)`

```Plane(Vec3D origin, ReadonlyVec3D norm)```

Method Summary
` Plane.Classifier` ```classifyPoint(ReadonlyVec3D p, float tolerance)```
Classifies the relative position of the given point to the plane using the given tolerance.
` boolean` `containsPoint(ReadonlyVec3D p)`
Checks if the point is within the given shape/volume.
` float` `getDistanceToPoint(Vec3D p)`
Calculates distance from the plane to point P.
` ReadonlyVec3D` `getIntersectionWithRay(Ray3D r)`
Calculates the intersection point between plane and ray (line).
` Vec3D` `getProjectedPoint(Vec3D p)`

` float` `intersectRayDistance(Ray3D ray)`
Calculates the distance of the vector to the given plane in the specified direction.
` Mesh3D` `toMesh(float size)`
Creates a TriangleMesh representation of the plane as a finite, squared quad of the requested size, centred around the current plane point.
` Mesh3D` ```toMesh(Mesh3D mesh, float size)```

` java.lang.String` `toString()`

Methods inherited from class toxi.geom.Vec3D
`abs, add, add, add, addSelf, addSelf, angleBetween, angleBetween, clear, compareTo, constrain, constrain, copy, cross, cross, crossInto, crossSelf, distanceTo, distanceToSquared, dot, dot, equals, equalsWithTolerance, floor, frac, fromXYTheta, fromXZTheta, fromYZTheta, getAbs, getComponent, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getNormalized, getNormalizedTo, getReciprocal, getReflected, getRotatedAroundAxis, getRotatedX, getRotatedY, getRotatedZ, getSignum, hashCode, headingXY, headingXZ, headingYZ, immutable, interpolateTo, interpolateTo, interpolateTo, interpolateTo, interpolateToSelf, interpolateToSelf, invert, isInAABB, isInAABB, isMajorAxis, isZeroVector, jitter, jitter, jitter, jitter, jitter, jitter, limit, magnitude, magSquared, max, maxSelf, min, minSelf, modSelf, modSelf, normalize, normalizeTo, randomVector, randomVector, reciprocal, reflect, rotateAroundAxis, rotateX, rotateY, rotateZ, roundToAxis, scale, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, set, set, set, setComponent, setComponent, setXY, shuffle, signum, sub, sub, sub, subSelf, subSelf, to2DXY, to2DXZ, to2DYZ, toArray, toArray4, toCartesian, toSpherical, x, y, z`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### XY

`public static final Plane XY`

### XZ

`public static final Plane XZ`

### YZ

`public static final Plane YZ`

### normal

`public Vec3D normal`
Constructor Detail

### Plane

`public Plane()`

### Plane

`public Plane(Triangle3D t)`

### Plane

```public Plane(Vec3D origin,
Method Detail

### classifyPoint

```public Plane.Classifier classifyPoint(ReadonlyVec3D p,
float tolerance)```
Classifies the relative position of the given point to the plane using the given tolerance.

Returns:
One of the 3 classification types: FRONT, BACK, ON_PLANE

### containsPoint

`public boolean containsPoint(ReadonlyVec3D p)`
Description copied from interface: `Shape3D`
Checks if the point is within the given shape/volume.

Specified by:
`containsPoint` in interface `Shape3D`
Returns:
true, if inside

### getDistanceToPoint

`public float getDistanceToPoint(Vec3D p)`
Calculates distance from the plane to point P.

Parameters:
`p` -
Returns:
distance

### getIntersectionWithRay

`public ReadonlyVec3D getIntersectionWithRay(Ray3D r)`
Calculates the intersection point between plane and ray (line).

Parameters:
`r` -
Returns:
intersection point or null if ray doesn't intersect plane

### getProjectedPoint

`public Vec3D getProjectedPoint(Vec3D p)`

### intersectRayDistance

`public float intersectRayDistance(Ray3D ray)`
Calculates the distance of the vector to the given plane in the specified direction. A plane is specified by a 3D point and a normal vector perpendicular to the plane. Normalized directional vectors expected (for rayDir and planeNormal).

Parameters:
`ray` - intersection ray
Returns:
distance to plane in world units, -1 if no intersection.

### toMesh

`public Mesh3D toMesh(float size)`
Creates a TriangleMesh representation of the plane as a finite, squared quad of the requested size, centred around the current plane point.

Parameters:
`size` - desired edge length
Returns:
mesh

### toMesh

```public Mesh3D toMesh(Mesh3D mesh,
float size)```

### toString

`public java.lang.String toString()`
Overrides:
`toString` in class `Vec3D`