|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.limdul.cassiopeia.data.MathTools
public final class MathTools
Stellt Mathematische Funktionen zur Verfügung.
| Method Summary | |
|---|---|
static double |
distancePointLine(int lx1,
int ly1,
int lx2,
int ly2,
int px,
int py)
Berechnet den Abstand Punkt-Linie. |
static double |
euklidDistance(int x1,
int y1,
int x2,
int y2)
Berechnet die Euklidische Distanz zwischen den Punkten. |
static PositionList |
getSurroundingPositions(Position startPos,
boolean includeStartPos)
Liefert die 8 umgebenden Positionen. |
static Position |
getTopLeft(int rotation,
int x,
int y,
int centerX,
int centerY,
int pictureWidth)
Liefert die Position links oben des Bildes nach der Rotation. |
static Position |
getTopLeft(int rotation,
Position pos,
int centerX,
int centerY,
int pictureWidth)
Liefert die Position links oben des Bildes nach der Rotation. |
static Position |
rotateVertex(int rotation,
int x,
int y,
int centerX,
int centerY)
Rotiert einen Punkt um einen andern. |
static Position |
scalePosition(Position orig,
int actualSize,
int origSize)
Skaliert die Position. |
static String |
toHex(byte value)
Liefert die Hexdarstellung des Strings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Position rotateVertex(int rotation,
int x,
int y,
int centerX,
int centerY)
rotation - Um wieviel rotiert werden soll in 90 Grad Abständen.x - Die zu rotierende X-Koordinate.y - Die zu rotierende Y-Koordinate.centerX - Die X-Koordinate des Drehpunktes.centerY - Die Y-Koordinate des Drehpunktes.
public static double euklidDistance(int x1,
int y1,
int x2,
int y2)
x1 - Die X-Koordinate des ersten Punktes.y1 - Die Y-Koordinate des ersten Punktes.x2 - Die X-Koordinate des zweiten Punktes.y2 - Die Y-Koordinate des zweiten Punktes.
public static Position getTopLeft(int rotation,
int x,
int y,
int centerX,
int centerY,
int pictureWidth)
rotation - Die Rotation.x - Die zu rotierende X-Koordinate.y - Die zu rotierende Y-Koordinate.centerX - Die X-Koordinate des Drehpunktes.centerY - Die Y-Koordinate des Drehpunktes.pictureWidth - Die Breite des Bildes
public static Position getTopLeft(int rotation,
Position pos,
int centerX,
int centerY,
int pictureWidth)
rotation - Die Rotation.pos - Der zu rotierende Punkt.centerX - Die X-Koordinate des Drehpunktes.centerY - Die Y-Koordinate des Drehpunktes.pictureWidth - Die Breite des Bildes
public static Position scalePosition(Position orig,
int actualSize,
int origSize)
orig - Die orginale Position.actualSize - Die aktuelle GrößeorigSize - Die orginale Größe.
public static double distancePointLine(int lx1,
int ly1,
int lx2,
int ly2,
int px,
int py)
lx1 - X-Koordinate des Anfangs des Liniensegmentes.ly1 - Y-Koordinate des Anfangs des Liniensegmentes.lx2 - X-Koordinate des Ende des Liniensegmentes.ly2 - Y-Koordinate des Ende des Liniensegmentes.px - X-Koordinate des Punktes.py - Y-Koordinate des Punktes.
public static PositionList getSurroundingPositions(Position startPos,
boolean includeStartPos)
startPos - Die Startposition.includeStartPos - Ob die Startposition mitzurückgeliefert werden soll.
public static String toHex(byte value)
value - Der Bytewert
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||