From 88f6a0bcc836fb19c00970632f46d8cc5b5ca2bd Mon Sep 17 00:00:00 2001 From: "J. Neugebauer" Date: Sun, 2 Jan 2022 22:12:56 +0100 Subject: [PATCH] Zufallsfarben und weitere mathematische Funktionen --- src/schule/ngb/zm/Constants.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/schule/ngb/zm/Constants.java b/src/schule/ngb/zm/Constants.java index d79e9ee..542ef5c 100644 --- a/src/schule/ngb/zm/Constants.java +++ b/src/schule/ngb/zm/Constants.java @@ -111,6 +111,10 @@ public class Constants { 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 ) { return Math.abs(x); @@ -132,6 +136,14 @@ public class Constants { 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 ) { return Math.sin(x); }