Class PeriodicFunction

java.lang.Object
org.ojalgo.function.series.PeriodicFunction
All Implemented Interfaces:
DoubleUnaryOperator, Function<Double,Double>, UnaryOperator<Double>, BasicFunction, PrimitiveFunction.Unary, UnaryFunction<Double>

public final class PeriodicFunction extends Object implements PrimitiveFunction.Unary
A periodic function is a function that repeats its values in regular intervals or periods. The most important examples are the trigonometric functions, which repeat over intervals of length 2π radians.

This class allows you to create a periodic function from any other function. The base function only needs to be defined over the interval specified in this class, The resulting function will repeat the base function in regular periods. The default period is 2π, but it's possible to specify any other period. The default origin is zero, but it's possible to specify any other origin.

  • Field Details

    • SAWTOOTH

      public static final PeriodicFunction SAWTOOTH
      https://en.wikipedia.org/wiki/Sawtooth_wave

      Domain: (-∞, ∞) by repeating/shifting the definition interval [0, 2π).
      Range: [-1, 1].

    • SINE

      public static final PeriodicFunction SINE
      https://en.wikipedia.org/wiki/Sine_wave

      Domain: (-∞, ∞) by repeating/shifting the definition interval [0, 2π).
      Range: [-1, 1].

    • SQUARE

      public static final PeriodicFunction SQUARE
      https://en.wikipedia.org/wiki/Square_wave

      Domain: (-∞, ∞) by repeating/shifting the definition interval [0, 2π).
      Range: [-1, 1].

    • TRIANGLE

      public static final PeriodicFunction TRIANGLE
      https://en.wikipedia.org/wiki/Triangle_wave

      Domain: (-∞, ∞) by repeating/shifting the definition interval [0, 2π).
      Range: [-1, 1].

    • myOrigin

      private final double myOrigin
    • myPeriod

      private final double myPeriod
    • myShape

      private final DoubleUnaryOperator myShape
  • Constructor Details

    • PeriodicFunction

      PeriodicFunction(double origin, DoubleUnaryOperator shape, double period)
  • Method Details