Interface Interpolation

All Known Subinterfaces:
Interpolation
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Interpolation
Interface marking the implementing class as an interpolation function for noise generation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Interpolation
     
    static final Interpolation
     
    static final Interpolation
     
    static final Interpolation
     
    static final Interpolation
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    lerp(double[] positions, double[] values)
    Interpolates between an unknown number of values.
    double
    lerp(double x, double a, double b)
    Interpolates a value between two known values.
  • Field Details

  • Method Details

    • lerp

      double lerp(double x, double a, double b)
      Interpolates a value between two known values.
      Parameters:
      x - Position for the data to be interpolated.
      a - The first known value.
      b - The second known value.
      Returns:
      an interpolated value for x.
    • lerp

      default double lerp(double[] positions, double[] values)
      Interpolates between an unknown number of values. The amount of positions repsents the dimension The amount of values must be 2^(amount of position).
      Parameters:
      positions - A list of positions starting with the first stage position and going up in order.
      values - A list of values starting with the first stage values and going up in order.
      Returns:
      an interpolated value between all the given positions.