public class OrientedPoint extends Object implements Hyperplane<Euclidean1D>
An hyperplane in 1D is a simple point, its orientation being a boolean.
Instances of this class are guaranteed to be immutable.
Constructor and Description |
---|
OrientedPoint(Vector1D location,
boolean direct,
double tolerance)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
OrientedPoint |
copySelf()
Copy the instance.
|
SubOrientedPoint |
emptyHyperplane()
Build a sub-hyperplane covering nothing.
|
Vector1D |
getLocation()
Get the hyperplane location on the real line.
|
double |
getOffset(Point<Euclidean1D> point)
Get the offset (oriented distance) of a point.
|
double |
getOffset(Vector<Euclidean1D> vector)
Get the offset (oriented distance) of a vector.
|
double |
getTolerance()
Get the tolerance below which points are considered to belong to the hyperplane.
|
boolean |
isDirect()
Check if the hyperplane orientation is direct.
|
Point<Euclidean1D> |
project(Point<Euclidean1D> point)
Project a point to the hyperplane.
|
void |
revertSelf()
Revert the instance.
|
boolean |
sameOrientationAs(Hyperplane<Euclidean1D> other)
Check if the instance has the same orientation as another hyperplane.
|
SubOrientedPoint |
wholeHyperplane()
Build a region covering the whole hyperplane.
|
IntervalsSet |
wholeSpace()
Build a region covering the whole space.
|
public OrientedPoint(Vector1D location, boolean direct, double tolerance)
location
- location of the hyperplanedirect
- if true, the plus side of the hyperplane is towards
abscissas greater than location
tolerance
- tolerance below which points are considered to belong to the hyperplanepublic OrientedPoint copySelf()
Since instances are immutable, this method directly returns the instance.
copySelf
in interface Hyperplane<Euclidean1D>
public double getOffset(Vector<Euclidean1D> vector)
vector
- vector to checkpublic double getOffset(Point<Euclidean1D> point)
The offset is 0 if the point is on the underlying hyperplane, it is positive if the point is on one particular side of the hyperplane, and it is negative if the point is on the other side, according to the hyperplane natural orientation.
getOffset
in interface Hyperplane<Euclidean1D>
point
- point to checkpublic SubOrientedPoint wholeHyperplane()
Since this class represent zero dimension spaces which does
not have lower dimension sub-spaces, this method returns a dummy
implementation of a SubHyperplane
.
This implementation is only used to allow the SubHyperplane
class implementation to work properly, it should
not be used otherwise.
wholeHyperplane
in interface Hyperplane<Euclidean1D>
public SubOrientedPoint emptyHyperplane()
Since this class represent zero dimension spaces which does
not have lower dimension sub-spaces, this method returns a dummy
implementation of a SubHyperplane
.
This implementation is only used to allow the SubHyperplane
class implementation to work properly, it should
not be used otherwise.
emptyHyperplane
in interface Hyperplane<Euclidean1D>
public IntervalsSet wholeSpace()
wholeSpace
in interface Hyperplane<Euclidean1D>
IntervalsSet
instance)public boolean sameOrientationAs(Hyperplane<Euclidean1D> other)
This method is expected to be called on parallel hyperplanes. The method should not re-check for parallelism, only for orientation, typically by testing something like the sign of the dot-products of normals.
sameOrientationAs
in interface Hyperplane<Euclidean1D>
other
- other hyperplane to check against the instancepublic Point<Euclidean1D> project(Point<Euclidean1D> point)
project
in interface Hyperplane<Euclidean1D>
point
- point to projectpublic double getTolerance()
getTolerance
in interface Hyperplane<Euclidean1D>
public Vector1D getLocation()
public boolean isDirect()
public void revertSelf()
Copyright © 2016-2022 CS GROUP. All rights reserved.