org.apache.lucene.spatial.spatial4j.geo3d

## Class Plane

• Direct Known Subclasses:
SidedPlane

```public class Plane
extends Vector```
We know about three kinds of planes. First kind: general plain through two points and origin Second kind: horizontal plane at specified height. Third kind: vertical plane with specified x and y value, through origin.
WARNING: This API is experimental and might change in incompatible ways in the next release.
• ### Field Summary

Fields
Modifier and Type Field and Description
`double` `D`
`protected static Membership[]` `NO_BOUNDS`
`protected static GeoPoint[]` `NO_POINTS`
• ### Fields inherited from class org.apache.lucene.spatial.spatial4j.geo3d.Vector

`MINIMUM_RESOLUTION, MINIMUM_RESOLUTION_CUBED, MINIMUM_RESOLUTION_SQUARED, x, y, z`
• ### Constructor Summary

Constructors
Constructor and Description
`Plane(double height)`
Construct a horizontal plane at a specified Z.
```Plane(double x, double y)```
Construct a vertical plane through a specified x, y and origin.
```Plane(double A, double B, double C, double D)```
Construct a plane with all four coefficients defined.
```Plane(Vector v, double D)```
Construct a plane with a specific vector, and D offset from origin.
```Plane(Vector A, Vector B)```
Construct a plane through two points and origin.
• ### Method Summary

Methods
Modifier and Type Method and Description
`protected static void` ```addPoint(Bounds boundsInfo, Membership[] bounds, double x, double y, double z)```
`boolean` `equals(Object o)`
`double` ```evaluate(double x, double y, double z)```
Evaluate the plane equation for a given point, as represented by a vector.
`double` `evaluate(Vector v)`
Evaluate the plane equation for a given point, as represented by a vector.
`boolean` ```evaluateIsZero(double x, double y, double z)```
Evaluate the plane equation for a given point, as represented by a vector.
`boolean` `evaluateIsZero(Vector v)`
Evaluate the plane equation for a given point, as represented by a vector.
`protected GeoPoint[]` ```findIntersections(Plane q, Membership[] bounds, Membership[] moreBounds)```
Find the intersection points between two planes, given a set of bounds.
`GeoPoint` `getSampleIntersectionPoint(Plane q)`
Find a sample point on the intersection between two planes and the unit sphere.
`int` `hashCode()`
`GeoPoint[]` ```interpolate(GeoPoint start, GeoPoint end, double[] proportions)```
Find points on the boundary of the intersection of a plane and the unit sphere, given a starting point, and ending point, and a list of proportions of the arc (e.g.
`boolean` ```intersects(Plane q, GeoPoint[] notablePoints, GeoPoint[] moreNotablePoints, Membership[] bounds, Membership... moreBounds)```
Determine whether the plane intersects another plane within the bounds provided.
`protected boolean` `isNumericallyIdentical(Plane p)`
Returns true if this plane and the other plane are identical within the margin of error.
`protected static boolean` ```meetsAllBounds(GeoPoint p, Membership[] bounds, Membership[] moreBounds)```
`protected static Vector` ```modify(GeoPoint start, double transX, double transY, double transZ, double sinRA, double cosRA, double sinHA, double cosHA)```
Modify a point to produce a vector in translated/rotated space.
`Plane` `normalize()`
Build a normalized plane, so that the vector is normalized.
`void` ```recordBounds(Bounds boundsInfo, Membership... bounds)```
Accumulate bounds information for this plane, intersected with the unit sphere.
`void` ```recordBounds(Plane q, Bounds boundsInfo, Membership... bounds)```
Accumulate bounds information for this plane, intersected with another plane and with the unit sphere.
`protected static GeoPoint` ```reverseModify(Vector point, double transX, double transY, double transZ, double sinRA, double cosRA, double sinHA, double cosHA)```
Reverse modify a point to produce a GeoPoint in normal space.
`String` `toString()`
• ### Methods inherited from class org.apache.lucene.spatial.spatial4j.geo3d.Vector

`dotProduct, dotProduct, isWithin, linearDistance, linearDistance, linearDistanceSquared, linearDistanceSquared, magnitude, normalDistance, normalDistance, normalDistanceSquared, normalDistanceSquared, rotateXY, rotateXY, rotateXZ, rotateXZ, rotateZY, rotateZY, translate`
• ### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### Field Detail

• #### NO_POINTS

`protected static final GeoPoint[] NO_POINTS`
• #### NO_BOUNDS

`protected static final Membership[] NO_BOUNDS`
• #### D

`public final double D`
• ### Constructor Detail

• #### Plane

```public Plane(double A,
double B,
double C,
double D)```
Construct a plane with all four coefficients defined.
• #### Plane

```public Plane(Vector A,
Vector B)```
Construct a plane through two points and origin.
Parameters:
`A` - is the first point (origin based).
`B` - is the second point (origin based).
• #### Plane

`public Plane(double height)`
Construct a horizontal plane at a specified Z.
Parameters:
`height` - is the specified Z coordinate.
• #### Plane

```public Plane(double x,
double y)```
Construct a vertical plane through a specified x, y and origin.
Parameters:
`x` - is the specified x value.
`y` - is the specified y value.
• #### Plane

```public Plane(Vector v,
double D)```
Construct a plane with a specific vector, and D offset from origin.
Parameters:
`D` - is the D offset from the origin.
• ### Method Detail

• #### evaluate

`public double evaluate(Vector v)`
Evaluate the plane equation for a given point, as represented by a vector.
Parameters:
`v` - is the vector.
Returns:
the result of the evaluation.
• #### evaluate

```public double evaluate(double x,
double y,
double z)```
Evaluate the plane equation for a given point, as represented by a vector.
• #### evaluateIsZero

`public boolean evaluateIsZero(Vector v)`
Evaluate the plane equation for a given point, as represented by a vector.
Parameters:
`v` - is the vector.
Returns:
true if the result is on the plane.
• #### evaluateIsZero

```public boolean evaluateIsZero(double x,
double y,
double z)```
Evaluate the plane equation for a given point, as represented by a vector.
Returns:
true if the result is on the plane.
• #### normalize

`public Plane normalize()`
Build a normalized plane, so that the vector is normalized.
Overrides:
`normalize` in class `Vector`
Returns:
the normalized plane object, or null if the plane is indeterminate.
• #### interpolate

```public GeoPoint[] interpolate(GeoPoint start,
GeoPoint end,
double[] proportions)```
Find points on the boundary of the intersection of a plane and the unit sphere, given a starting point, and ending point, and a list of proportions of the arc (e.g. 0.25, 0.5, 0.75). The angle between the starting point and ending point is assumed to be less than pi.
• #### modify

```protected static Vector modify(GeoPoint start,
double transX,
double transY,
double transZ,
double sinRA,
double cosRA,
double sinHA,
double cosHA)```
Modify a point to produce a vector in translated/rotated space.
• #### reverseModify

```protected static GeoPoint reverseModify(Vector point,
double transX,
double transY,
double transZ,
double sinRA,
double cosRA,
double sinHA,
double cosHA)```
Reverse modify a point to produce a GeoPoint in normal space.
• #### findIntersections

```protected GeoPoint[] findIntersections(Plane q,
Membership[] bounds,
Membership[] moreBounds)```
Find the intersection points between two planes, given a set of bounds.
Parameters:
`q` - is the plane to intersect with.
`bounds` - is the set of bounds.
`moreBounds` - is another set of bounds.
Returns:
the intersection point(s) on the unit sphere, if there are any.
• #### recordBounds

```public void recordBounds(Plane q,
Bounds boundsInfo,
Membership... bounds)```
Accumulate bounds information for this plane, intersected with another plane and with the unit sphere. Updates both latitude and longitude information, using max/min points found within the specified bounds.
Parameters:
`q` - is the plane to intersect with.
`boundsInfo` - is the info to update with additional bounding information.
`bounds` - are the surfaces delineating what's inside the shape.
• #### recordBounds

```public void recordBounds(Bounds boundsInfo,
Membership... bounds)```
Accumulate bounds information for this plane, intersected with the unit sphere. Updates both latitude and longitude information, using max/min points found within the specified bounds.
Parameters:
`boundsInfo` - is the info to update with additional bounding information.
`bounds` - are the surfaces delineating what's inside the shape.

```protected static void addPoint(Bounds boundsInfo,
Membership[] bounds,
double x,
double y,
double z)```
• #### intersects

```public boolean intersects(Plane q,
GeoPoint[] notablePoints,
GeoPoint[] moreNotablePoints,
Membership[] bounds,
Membership... moreBounds)```
Determine whether the plane intersects another plane within the bounds provided.
Parameters:
`q` - is the other plane.
`notablePoints` - are points to look at to disambiguate cases when the two planes are identical.
`moreNotablePoints` - are additional points to look at to disambiguate cases when the two planes are identical.
`bounds` - is one part of the bounds.
`moreBounds` - are more bounds.
Returns:
true if there's an intersection.
• #### isNumericallyIdentical

`protected boolean isNumericallyIdentical(Plane p)`
Returns true if this plane and the other plane are identical within the margin of error.
• #### meetsAllBounds

```protected static boolean meetsAllBounds(GeoPoint p,
Membership[] bounds,
Membership[] moreBounds)```
• #### getSampleIntersectionPoint

`public GeoPoint getSampleIntersectionPoint(Plane q)`
Find a sample point on the intersection between two planes and the unit sphere.
• #### toString

`public String toString()`
Overrides:
`toString` in class `Vector`
• #### equals

`public boolean equals(Object o)`
Overrides:
`equals` in class `Vector`
• #### hashCode

`public int hashCode()`
Overrides:
`hashCode` in class `Vector`