public class Plane extends Object implements Cloneable, Serializable
c
, cx
and cy
coefficients as below:
z(x,y) = c + cx*x + cy*yThose coefficients can be set directly, or computed by a linear regression of this plane through a set of three-dimensional points.
Modifier and Type | Field and Description |
---|---|
double |
c
The c coefficient for this plane.
|
double |
cx
The cx coefficient for this plane.
|
double |
cy
The cy coefficient for this plane.
|
Constructor and Description |
---|
Plane()
Construct a new plane.
|
Modifier and Type | Method and Description |
---|---|
Plane |
clone()
Returns a clone of this plane.
|
boolean |
equals(Object object)
Compares this plane with the specified object for equality.
|
int |
hashCode()
Returns a hash code value for this plane.
|
void |
setPlane(double[][] points)
Computes the plane's coefficients from the specified points.
|
void |
setPlane(double[] x,
double[] y,
double[] z)
Computes the plane's coefficients from a set of points.
|
String |
toString()
Returns a string representation of this plane.
|
double |
x(double y,
double z)
Computes the x value for the specified (y,z) point.
|
double |
y(double x,
double z)
Computes the y value for the specified (x,z) point.
|
double |
z(double x,
double y)
Computes the z value for the specified (x,y) point.
|
public double c
public double cx
public double cy
public final double z(double x, double y)
z(x,y) = c + cx*x + cy*y
x
- The x value.y
- The y value.public final double y(double x, double z)
y(x,z) = (z - (c+cx*x)) / cy
x
- The x value.z
- The y value.public final double x(double y, double z)
x(y,z) = (z - (c+cy*y)) / cx
y
- The x value.z
- The y value.public void setPlane(double[][] points) throws ArithmeticException
double[] P1 = new double[]{ a.getX(), a.getY(), a.getZ() );
double[] P2 = new double[]{ b.getX(), b.getY(), b.getZ() );
double[] P3 = new double[]{ c.getX(), c.getY(), c.getZ() );
plane.setPlane( new double[][]{ P1, P2, P3 } );
points
- Array of three pointsArithmeticException
- If the three points are colinear.public void setPlane(double[] x, double[] y, double[] z) throws IllegalArgumentException
double[] X = new double[]{ a.getX(), b.getX(), c.getX() );
double[] Y = new double[]{ a.getX(), b.getX(), c.getX() );
double[] Z = new double[]{ a.getZ(), b.getZ(), c.getZ() );
plane.setPlane( X, Y, Z );
x
- vector of x coordinatesy
- vector of y coordinatesz
- vector of z valuesMismatchedSizeException
- if x, y and z
don't have the same length.IllegalArgumentException
public String toString()
public boolean equals(Object object)
public int hashCode()
public Plane clone()
clone
in class Object
Object.clone()
Copyright © 1996–2019 Geotools. All rights reserved.