Class CutAngle
- All Implemented Interfaces:
Hyperplane<Point1S>
Hyperplanes split the spaces they are embedded in into three distinct parts:
the hyperplane itself, a plus side and a minus side. However, since spherical
space wraps around, a single oriented point is not sufficient to partition the space;
any point could be classified as being on the plus or minus side of a hyperplane
depending on the direction that the circle is traversed. The approach taken in this
class to address this issue is to (1) define a second, implicit cut point at 0pi and
(2) define the domain of hyperplane points (for partitioning purposes) to be the
range [0, 2pi). Each hyperplane then splits the space into the intervals
[0, x] and [x, 2pi), where x is the location of the hyperplane.
One way to visualize this is to picture the circle as a cake that has already been
cut at 0pi. Each hyperplane then specifies the location of the second
cut of the cake, with the plus and minus sides being the pieces thus cut.
Note that with the hyperplane partitioning rules described above, the hyperplane
at 0pi is unique in that it has the entire space on one side (minus the hyperplane
itself) and no points whatsoever on the other. This is very different from hyperplanes in
Euclidean space, which always have infinitely many points on both sides.
Instances of this class are guaranteed to be immutable.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionClassify a point with respect to this hyperplane.booleanReturn true if this instance should be considered equivalent to the argument, using the given precision context for comparison.booleandoubleGet the location of the hyperplane as a single value.doubleGet the location of the hyperplane as a single value, normalized to the range[0, 2pi).getPoint()Get the location of the hyperplane as a point.inthashCode()booleanReturn true if the hyperplane is oriented with its plus side pointing toward increasing angles.doubleGet the offset (oriented distance) of a point with respect to this instance.Project a point onto this instance.reverse()Return a hyperplane that has the opposite orientation as this instance.booleansimilarOrientation(Hyperplane<Point1S> other) Return true if this instance has a similar orientation to the given hyperplane, meaning that they point in generally the same direction.span()Return aHyperplaneConvexSubsetspanning this entire hyperplane.toString()Transform this instance using the givenTransform.Methods inherited from class AbstractHyperplane
contains, getPrecision
-
Method Details
-
getPoint
-
getAzimuth
Get the location of the hyperplane as a single value. This is equivalent tocutAngle.getPoint().getAzimuth().- Returns:
- the location of the hyperplane as a single value.
- See Also:
-
getNormalizedAzimuth
Get the location of the hyperplane as a single value, normalized to the range[0, 2pi). This is equivalent tocutAngle.getPoint().getNormalizedAzimuth().- Returns:
- the location of the hyperplane, normalized to the range
[0, 2pi) - See Also:
-
isPositiveFacing
Return true if the hyperplane is oriented with its plus side pointing toward increasing angles.- Returns:
- true if the hyperplane is facing in the direction of increasing angles
-
eq
public boolean eq(CutAngle other, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return true if this instance should be considered equivalent to the argument, using the given precision context for comparison.The instances are considered equivalent if they
- have equivalent point locations (points separated by multiples of 2pi are considered equivalent) and
- point in the same direction.
- Parameters:
other- point to compare withprecision- precision context to use for the comparison- Returns:
- true if this instance should be considered equivalent to the argument
- See Also:
-
offset
-
classify
Classify a point with respect to this hyperplane.- Specified by:
classifyin interfaceHyperplane<Point1S>- Overrides:
classifyin classAbstractHyperplane<Point1S>- Parameters:
pt- the point to classify- Returns:
- the relative location of the point with respect to this instance
-
project
-
reverse
-
transform
-
similarOrientation
Return true if this instance has a similar orientation to the given hyperplane, meaning that they point in generally the same direction. This method is not used to determine exact equality of hyperplanes, but rather to determine whether two hyperplanes that contain the same points are parallel (point in the same direction) or anti-parallel (point in opposite directions).- Parameters:
other- the hyperplane to compare with- Returns:
- true if the hyperplanes point in generally the same direction and could possibly be parallel
-
span
Return aHyperplaneConvexSubsetspanning this entire hyperplane. The returned subset contains all points lying in this hyperplane and no more.Since there are no subspaces in spherical 1D space, this method effectively returns a stub implementation of
HyperplaneConvexSubset, the main purpose of which is to support the proper functioning of the partitioning code.- Returns:
- a
HyperplaneConvexSubsetcontaining all points lying in this hyperplane
-
hashCode
-
equals
-
toString
-