Class Reduce

  • All Implemented Interfaces:
    java.util.function.DoubleUnaryOperator

    public class Reduce
    extends java.lang.Object
    implements java.util.function.DoubleUnaryOperator
    Reduces |a - offset| to the primary interval [0, |period|). Specifically, the computed value is: a - |period| * floor((a - offset) / |period|) - offset.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double offset
      Offset.
      private double period
      Period.
    • Constructor Summary

      Constructors 
      Constructor Description
      Reduce​(double offset, double period)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double applyAsDouble​(double x)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.DoubleUnaryOperator

        andThen, compose
    • Field Detail

      • offset

        private final double offset
        Offset.
      • period

        private final double period
        Period.
    • Constructor Detail

      • Reduce

        public Reduce​(double offset,
                      double period)
        Parameters:
        offset - Value that will be mapped to 0.
        period - Period.
    • Method Detail

      • applyAsDouble

        public double applyAsDouble​(double x)
        Specified by:
        applyAsDouble in interface java.util.function.DoubleUnaryOperator