Package org.apache.commons.numbers.angle
Class Angle.Normalizer
java.lang.Object
org.apache.commons.numbers.angle.Angle.Normalizer
- All Implemented Interfaces:
DoubleUnaryOperator
- Enclosing class:
Angle
Normalizes an angle around a center value.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNormalizer(double lo, double period) Note: It is assumed that both arguments have the same unit. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.DoubleUnaryOperator
andThen, compose
-
Field Details
-
lo
private final double loLower bound. -
hi
private final double hiUpper bound. -
period
private final double periodPeriod. -
reduce
Normalizer.
-
-
Constructor Details
-
Normalizer
Normalizer(double lo, double period) Note: It is assumed that both arguments have the same unit.- Parameters:
lo- Lower bound of the desired interval.period- Circonference of the circle.
-
-
Method Details
-
applyAsDouble
public double applyAsDouble(double a) - Specified by:
applyAsDoublein interfaceDoubleUnaryOperator- Parameters:
a- Angle.- Returns:
= a - kwherekis an integer that satisfieslo <= a - k < lo + period.
-