Class OrientedPoints
java.lang.Object
org.apache.commons.geometry.euclidean.oned.OrientedPoints
Class containing factory methods for constructing
OrientedPoint
instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OrientedPoint
createNegativeFacing
(double location, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given location, oriented so that it is facing negative infinity.static OrientedPoint
createNegativeFacing
(Vector1D point, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given point, oriented so that it is facing negative infinity.static OrientedPoint
createPositiveFacing
(double location, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given location, oriented so that it is facing positive infinity.static OrientedPoint
createPositiveFacing
(Vector1D point, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given point, oriented so that it is facing positive infinity.static OrientedPoint
fromLocationAndDirection
(double location, boolean positiveFacing, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance from the given location and boolean direction value.static OrientedPoint
fromPointAndDirection
(Vector1D point, boolean positiveFacing, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance from the given point and boolean direction value.static OrientedPoint
fromPointAndDirection
(Vector1D point, Vector1D direction, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance from the given point and direction.
-
Constructor Details
-
OrientedPoints
private OrientedPoints()Utility class; no instantiation.
-
-
Method Details
-
fromLocationAndDirection
public static OrientedPoint fromLocationAndDirection(double location, boolean positiveFacing, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance from the given location and boolean direction value.- Parameters:
location
- the location of the hyperplanepositiveFacing
- if true, the hyperplane will face toward positive infinity; otherwise, it will point toward negative infinity.precision
- precision context used to compare floating point values- Returns:
- a new instance
-
fromPointAndDirection
public static OrientedPoint fromPointAndDirection(Vector1D point, boolean positiveFacing, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance from the given point and boolean direction value.- Parameters:
point
- the location of the hyperplanepositiveFacing
- if true, the hyperplane will face toward positive infinity; otherwise, it will point toward negative infinity.precision
- precision context used to compare floating point values- Returns:
- a new instance
-
fromPointAndDirection
public static OrientedPoint fromPointAndDirection(Vector1D point, Vector1D direction, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance from the given point and direction.- Parameters:
point
- the location of the hyperplanedirection
- the direction of the plus side of the hyperplaneprecision
- precision context used to compare floating point values- Returns:
- a new instance oriented in the given direction
- Throws:
IllegalArgumentException
- if the direction is zero as evaluated by the given precision context
-
createPositiveFacing
public static OrientedPoint createPositiveFacing(Vector1D point, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given point, oriented so that it is facing positive infinity.- Parameters:
point
- the location of the hyperplaneprecision
- precision context used to compare floating point values- Returns:
- a new instance oriented toward positive infinity
-
createPositiveFacing
public static OrientedPoint createPositiveFacing(double location, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given location, oriented so that it is facing positive infinity.- Parameters:
location
- the location of the hyperplaneprecision
- precision context used to compare floating point values- Returns:
- a new instance oriented toward positive infinity
-
createNegativeFacing
public static OrientedPoint createNegativeFacing(Vector1D point, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given point, oriented so that it is facing negative infinity.- Parameters:
point
- the location of the hyperplaneprecision
- precision context used to compare floating point values- Returns:
- a new instance oriented toward negative infinity
-
createNegativeFacing
public static OrientedPoint createNegativeFacing(double location, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Create a new instance at the given location, oriented so that it is facing negative infinity.- Parameters:
location
- the location of the hyperplaneprecision
- precision context used to compare floating point values- Returns:
- a new instance oriented toward negative infinity
-