public class Plane extends Object implements Cloneable, Serializable
z(x,y) = sx⋅x + sy⋅y + z₀Those coefficients can be set directly, or computed by a linear regression of this plane through a set of three-dimensional points.
Line
,
LinearTransformBuilder
,
Serialized FormDefined in the sis-utility
module
Constructor and Description |
---|
Plane()
Constructs a new plane with all coefficients initialized to
Double.NaN . |
Plane(double sx,
double sy,
double z0)
Constructs a new plane initialized to the given coefficients.
|
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.
|
double |
fit(double[] x,
double[] y,
double[] z)
Computes the plane's coefficients from the given ordinate values.
|
double |
fit(Iterable<? extends DirectPosition> points)
Computes the plane's coefficients from the given sequence of points.
|
int |
hashCode()
Returns a hash code value for this plane.
|
void |
setEquation(double sx,
double sy,
double z0)
Sets the equation of this plane to the given coefficients.
|
double |
slopeX()
Returns the slope along the x values.
|
double |
slopeY()
Returns the slope along the y values.
|
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.
|
double |
z0()
Returns the z value at (x,y) = (0,0).
|
public Plane()
Double.NaN
.public Plane(double sx, double sy, double z0)
sx
- The slope along the x values.sy
- The slope along the y values.z0
- The z value at (x,y) = (0,0).setEquation(double, double, double)
public final double slopeX()
public final double slopeY()
public final double z0()
z(double, double)
public final double x(double y, double z)
x(y,z) = (z - (z₀ + sy⋅y)) / sx
y
- The y value where to compute x.z
- The z value where to compute x.public final double y(double x, double z)
y(x,z) = (z - (z₀ + sx⋅x)) / sy
x
- The x value where to compute y.z
- The z value where to compute y.public final double z(double x, double y)
z(x,y) = sx⋅x + sy⋅y + z₀
x
- The x value where to compute z.y
- The y value where to compute z.z0()
public void setEquation(double sx, double sy, double z0)
sx
- The slope along the x values.sy
- The slope along the y values.z0
- The z value at (x,y) = (0,0).public double fit(double[] x, double[] y, double[] z)
Double.NaN
values are ignored.
The result is undetermined if all points are colinear.
x
- vector of x coordinates.y
- vector of y coordinates.z
- vector of z values.IllegalArgumentException
- if x, y and z do not have the same length.public double fit(Iterable<? extends DirectPosition> points)
Points shall be three dimensional with ordinate values in the (x,y,z) order.
Double.NaN
ordinate values are ignored.
The result is undetermined if all points are colinear.
points
- The three-dimensional points.MismatchedDimensionException
- if a point is not three-dimensional.public Plane clone()
public boolean equals(Object object)
public int hashCode()
Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.