Package org.apache.commons.numbers.angle
Class Reduce
java.lang.Object
org.apache.commons.numbers.angle.Reduce
- All Implemented Interfaces:
DoubleUnaryOperator
Reduces
|a - offset|
to the primary interval [0, |period|)
.
Specifically, the computed value
is:
a - |period| * floor((a - offset) / |period|) - offset
.-
Field Details
-
offset
private final double offsetOffset. -
period
private final double periodPeriod.
-
-
Constructor Details
-
Reduce
public Reduce(double offset, double period) Create an instance.- Parameters:
offset
- Value that will be mapped to0
.period
- Period.
-
-
Method Details
-
applyAsDouble
public double applyAsDouble(double x) - Specified by:
applyAsDouble
in interfaceDoubleUnaryOperator
-