Class OrientedPoint
- java.lang.Object
-
- org.hipparchus.geometry.euclidean.oned.OrientedPoint
-
- All Implemented Interfaces:
Hyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>
public class OrientedPoint extends Object implements Hyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>
This class represents a 1D oriented hyperplane.An hyperplane in 1D is a simple point, its orientation being a boolean.
Instances of this class are guaranteed to be immutable.
-
-
Constructor Summary
Constructors Constructor Description OrientedPoint(Vector1D location, boolean direct, double tolerance)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector1DarbitraryPoint()Get an arbitrary point in the hyperplane.OrientedPointcopySelf()Copy the instance.SubOrientedPointemptyHyperplane()Build a sub-hyperplane covering nothing.Vector1DgetLocation()Get the hyperplane location on the real line.doublegetOffset(Vector1D point)Get the offset (oriented distance) of a point.doublegetTolerance()Get the tolerance below which points are considered to belong to the hyperplane.booleanisDirect()Check if the hyperplane orientation is direct.Vector1DmoveToOffset(Vector1D point, double offset)Move point up to specified offset.Vector1Dproject(Vector1D point)Project a point to the hyperplane.voidrevertSelf()Revert the instance.booleansameOrientationAs(OrientedPoint other)Check if the instance has the same orientation as another hyperplane.SubOrientedPointwholeHyperplane()Build a region covering the whole hyperplane.IntervalsSetwholeSpace()Build a region covering the whole space.
-
-
-
Constructor Detail
-
OrientedPoint
public OrientedPoint(Vector1D location, boolean direct, double tolerance)
Simple constructor.- Parameters:
location- location of the hyperplanedirect- if true, the plus side of the hyperplane is towards abscissas greater thanlocationtolerance- tolerance below which points are considered to belong to the hyperplane
-
-
Method Detail
-
copySelf
public OrientedPoint copySelf()
Copy the instance.Since instances are immutable, this method directly returns the instance.
- Specified by:
copySelfin interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Returns:
- the instance itself
-
getOffset
public double getOffset(Vector1D point)
Get the offset (oriented distance) of a 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.
- Specified by:
getOffsetin interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Parameters:
point- point to check- Returns:
- offset of the point
-
moveToOffset
public Vector1D moveToOffset(Vector1D point, double offset)
Move point up to specified offset.Motion is orthogonal to the hyperplane
- Specified by:
moveToOffsetin interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Parameters:
point- point to moveoffset- desired offset- Returns:
- moved point at desired offset
-
arbitraryPoint
public Vector1D arbitraryPoint()
Get an arbitrary point in the hyperplane.- Specified by:
arbitraryPointin interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Returns:
- arbirary point in the hyperplane
-
wholeHyperplane
public SubOrientedPoint wholeHyperplane()
Build a region covering the whole hyperplane.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 theSubHyperplaneclass implementation to work properly, it should not be used otherwise.- Specified by:
wholeHyperplanein interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Returns:
- a dummy sub hyperplane
-
emptyHyperplane
public SubOrientedPoint emptyHyperplane()
Build a sub-hyperplane covering nothing..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 theSubHyperplaneclass implementation to work properly, it should not be used otherwise.- Specified by:
emptyHyperplanein interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Returns:
- a dummy sub hyperplane
-
wholeSpace
public IntervalsSet wholeSpace()
Build a region covering the whole space.- Specified by:
wholeSpacein interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Returns:
- a region containing the instance (really an
IntervalsSetinstance)
-
sameOrientationAs
public boolean sameOrientationAs(OrientedPoint other)
Check if the instance has the same orientation as another hyperplane.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.
- Specified by:
sameOrientationAsin interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Parameters:
other- other hyperplane to check against the instance- Returns:
- true if the instance and the other hyperplane have the same orientation
-
project
public Vector1D project(Vector1D point)
Project a point to the hyperplane.- Specified by:
projectin interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Parameters:
point- point to project- Returns:
- projected point
-
getTolerance
public double getTolerance()
Get the tolerance below which points are considered to belong to the hyperplane.- Specified by:
getTolerancein interfaceHyperplane<Euclidean1D,Vector1D,OrientedPoint,SubOrientedPoint>- Returns:
- tolerance below which points are considered to belong to the hyperplane
-
getLocation
public Vector1D getLocation()
Get the hyperplane location on the real line.- Returns:
- the hyperplane location
-
isDirect
public boolean isDirect()
Check if the hyperplane orientation is direct.- Returns:
- true if the plus side of the hyperplane is towards abscissae greater than hyperplane location
-
revertSelf
public void revertSelf()
Revert the instance.
-
-