java.lang.Object
org.sunflow.math.MathUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic final doubleclamp(double x, double min, double max) static final floatclamp(float x, float min, float max) static final intclamp(int x, int min, int max) static final floatfastPow(float a, float b) Computes a fast approximation toMath.pow(a, b).static final doublemax(double a, double b, double c) static final floatmax(float a, float b, float c) static final floatmax(float a, float b, float c, float d) static final intmax(int a, int b, int c) static final doublemin(double a, double b, double c) static final floatmin(float a, float b, float c) static final floatmin(float a, float b, float c, float d) static final intmin(int a, int b, int c) static final floatsmoothStep(float a, float b, float x)
-
Method Details
-
clamp
public static final int clamp(int x, int min, int max) -
clamp
public static final float clamp(float x, float min, float max) -
clamp
public static final double clamp(double x, double min, double max) -
min
public static final int min(int a, int b, int c) -
min
public static final float min(float a, float b, float c) -
min
public static final double min(double a, double b, double c) -
min
public static final float min(float a, float b, float c, float d) -
max
public static final int max(int a, int b, int c) -
max
public static final float max(float a, float b, float c) -
max
public static final double max(double a, double b, double c) -
max
public static final float max(float a, float b, float c, float d) -
smoothStep
public static final float smoothStep(float a, float b, float x) -
fastPow
public static final float fastPow(float a, float b) Computes a fast approximation toMath.pow(a, b). Adapted fromhttp://www.dctsystems.co.uk/Software/power.html .- Parameters:
a- a positive numberb- a number- Returns:
- a^b
-