api:documentation:math:start
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— | api:documentation:math:start [2024/08/31 10:03] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== Die Klasse Math ====== | ||
+ | <WRAP center round info 60%> | ||
+ | Die Klasse '' | ||
+ | <code myJava> | ||
+ | double w = Math.sqrt(12); | ||
+ | </ | ||
+ | um die Quadratwurzel von 12 zu errechnen und den Wert der Variable w zuzuweisen. Einen Überblick über alle statischen Methoden und Attribute der Klasse '' | ||
+ | Natürlich kannst Du auch einfach in der [[https:// | ||
+ | Hier findest Du [[: | ||
+ | </ | ||
+ | |||
+ | ====== Die Klasse String ====== | ||
+ | <WRAP center round info 60%> | ||
+ | Variablen des Datentyps '' | ||
+ | </ | ||
+ | |||
+ | ====== Die Klasse MathTools ====== | ||
+ | Die Klasse '' | ||
+ | |||
+ | ==== MathTools.intersectCircleWithPolygon ==== | ||
+ | < | ||
+ | |||
+ | <div class=" | ||
+ | |||
+ | <script type=" | ||
+ | println(" | ||
+ | |||
+ | Circle c = new Kreis1(400, 300, 100); | ||
+ | |||
+ | class Kreis1 extends Circle { | ||
+ | | ||
+ | Group intersectionPoints = new Group(); | ||
+ | | ||
+ | super(mx, my, radius); | ||
+ | p = new Polygon(false, | ||
+ | intersectionPoints.bringToFront(); | ||
+ | calculateIntersections(); | ||
+ | } | ||
+ | |||
+ | void calculateIntersections() { | ||
+ | |||
+ | Vector2[] points = MathTools.intersectCircleWithPolygon(getCenterX(), | ||
+ | intersectionPoints.destroyAllChildren(); | ||
+ | for(Vector2 point : points) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | | ||
+ | boolean calc = false; | ||
+ | if(isKeyDown(Key.ArrowRight)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(isKeyDown(Key.ArrowLeft)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(isKeyDown(Key.ArrowUp)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(isKeyDown(Key.ArrowDown)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(calc) { | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | </ | ||