Class Math

java.lang.Object
org.storynode.pigeon.math.Math

public class Math extends Object
Math utilities
Author:
Andrea Coronese
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    clamp(double val, double min, double max)
    Clamps a value between a min and max value (inclusive)
    static float
    clamp(float val, float min, float max)
    Clamps a value between a min and max value (inclusive)
    static int
    clamp(int val, int min, int max)
    Clamps a value between a min and max value (inclusive)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Math

      public Math()
  • Method Details

    • clamp

      public static float clamp(float val, float min, float max)
      Clamps a value between a min and max value (inclusive)
      Parameters:
      val - The value to clamp
      min - The minimum allowed value
      max - The maximum allowed value
      Returns:
      The clamped value
    • clamp

      public static int clamp(int val, int min, int max)
      Clamps a value between a min and max value (inclusive)
      Parameters:
      val - The value to clamp
      min - The minimum allowed value
      max - The maximum allowed value
      Returns:
      The clamped value
    • clamp

      public static double clamp(double val, double min, double max)
      Clamps a value between a min and max value (inclusive)
      Parameters:
      val - The value to clamp
      min - The minimum allowed value
      max - The maximum allowed value
      Returns:
      The clamped value