Class Angle.Normalizer

  • All Implemented Interfaces:
    java.util.function.DoubleUnaryOperator
    Enclosing class:
    Angle

    private static final class Angle.Normalizer
    extends java.lang.Object
    implements java.util.function.DoubleUnaryOperator
    Normalizes an angle around a center value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double hi
      Upper bound.
      private double lo
      Lower bound.
      private double period
      Period.
      private Reduce reduce
      Normalizer.
    • Constructor Summary

      Constructors 
      Constructor Description
      Normalizer​(double lo, double period)
      Note: It is assumed that both arguments have the same unit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double applyAsDouble​(double a)  
      • 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

      • lo

        private final double lo
        Lower bound.
      • hi

        private final double hi
        Upper bound.
      • period

        private final double period
        Period.
      • reduce

        private final Reduce reduce
        Normalizer.
    • Constructor Detail

      • 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 Detail

      • applyAsDouble

        public double applyAsDouble​(double a)
        Specified by:
        applyAsDouble in interface java.util.function.DoubleUnaryOperator
        Parameters:
        a - Angle.
        Returns:
        = a - k where k is an integer that satisfies lo <= a - k < lo + period.