Zufallsfarben und weitere mathematische Funktionen

This commit is contained in:
ngb
2022-01-02 22:12:56 +01:00
parent c6e3a3ac82
commit 88f6a0bcc8

View File

@@ -111,6 +111,10 @@ public class Constants {
return new Color(red, green, blue, alpha); return new Color(red, green, blue, alpha);
} }
public static Color randomColor() {
return color(random(10, 255), random(10, 255), random(10, 255), 255);
}
public static double abs( double x ) { public static double abs( double x ) {
return Math.abs(x); return Math.abs(x);
@@ -132,6 +136,14 @@ public class Constants {
return Math.ceil(x); return Math.ceil(x);
} }
public static double sqrt( double x ) {
return Math.sqrt(x);
}
public static double pow( double x, double p ) {
return Math.pow(x, p);
}
public static double sin( double x ) { public static double sin( double x ) {
return Math.sin(x); return Math.sin(x);
} }