public final class OrientedPoint extends AbstractHyperplane<Vector1D>
A hyperplane in 1D is a simple point, its orientation being a boolean indicating if the direction is positive or negative.
Instances of this class are guaranteed to be immutable.
OrientedPoints| Modifier and Type | Method and Description |
|---|---|
HyperplaneLocation |
classify(double location)
Classify the number line location with respect to the instance.
|
HyperplaneLocation |
classify(Vector1D pt) |
boolean |
eq(OrientedPoint other,
Precision.DoubleEquivalence precision)
Return true if this instance should be considered equivalent to the argument, using the
given precision context for comparison.
|
boolean |
equals(Object obj) |
Vector1D.Unit |
getDirection()
Get the direction of the hyperplane's plus side.
|
double |
getLocation()
Get the location of the hyperplane as a single value.
|
Vector1D |
getPoint()
Get the location of the hyperplane as a point.
|
int |
hashCode() |
boolean |
isPositiveFacing()
Return true if the hyperplane is oriented with its plus
side in the direction of positive infinity.
|
double |
offset(double location)
Compute the offset of the given number line location.
|
double |
offset(Vector1D pt) |
Vector1D |
project(Vector1D pt) |
OrientedPoint |
reverse() |
boolean |
similarOrientation(Hyperplane<Vector1D> other) |
HyperplaneConvexSubset<Vector1D> |
span() |
String |
toString() |
OrientedPoint |
transform(Transform<Vector1D> transform) |
contains, getPrecisionpublic Vector1D getPoint()
getLocation()public double getLocation()
pt.getPoint().getX().getPoint()public Vector1D.Unit getDirection()
public boolean isPositiveFacing()
public OrientedPoint reverse()
public OrientedPoint transform(Transform<Vector1D> transform)
public double offset(Vector1D pt)
public double offset(double location)
offset(Vector1D) for use in
one dimension.location - the number line location to compute the offset forpublic HyperplaneLocation classify(Vector1D pt)
classify in interface Hyperplane<Vector1D>classify in class AbstractHyperplane<Vector1D>public HyperplaneLocation classify(double location)
classify(Vector1D) for
use in one dimension.location - the number line location to classifypublic boolean similarOrientation(Hyperplane<Vector1D> other)
public HyperplaneConvexSubset<Vector1D> span()
Since there are no subspaces in 1D, this method effectively returns a stub implementation of
HyperplaneConvexSubset, the main purpose of which is to support the proper functioning
of the partitioning code.
public boolean eq(OrientedPoint other, Precision.DoubleEquivalence precision)
Instances are considered equivalent if they
other - the point to compare withprecision - precision context to use for the comparisonVector1D.eq(Vector1D, Precision.DoubleEquivalence)Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.