|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavaclient2.extra.PositionGeometryTools
public class PositionGeometryTools
Several methods for position geometric calculus.
Constructor Summary | |
---|---|
PositionGeometryTools()
|
Method Summary | |
---|---|
static int |
calcAngle(java.awt.Point p1,
java.awt.Point p2)
Calculate the angle between the line determined by the two points and the horizontal axis. |
static int |
calcDist(int x,
int y)
Calculate the distance between two X and Y points assuming that their counterparts are 0 using Pitagora's theorem. |
static int |
calcDist(java.awt.Point p1,
java.awt.Point p2)
Calculate the distance between two points (p1 and p2). |
static java.awt.Point |
calcDistPoint(java.awt.Point initP,
int dist,
int angle)
Calculate the coordinates of a point situated at distance dist, angle angle from a given point initP. |
static int |
calcX(java.awt.Point initP,
int dist,
int angle)
Calculate the X coordinate of a point situated at distance dist, angle angle from a given point initP. |
static int |
calcY(java.awt.Point initP,
int dist,
int angle)
Calculate the Y coordinate of a point situated at distance dist, angle angle from a given point initP. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PositionGeometryTools()
Method Detail |
---|
public static int calcDist(int x, int y)
x
- X's coordonate of the first point (Y=0)y
- Y's coordonate of the second point (X=0)
public static int calcDist(java.awt.Point p1, java.awt.Point p2)
p1
- first pointp2
- second point
public static int calcX(java.awt.Point initP, int dist, int angle)
initP
- reference pointdist
- distance from the reference point to the desired pointangle
- angle from the reference point to the desired point
public static int calcY(java.awt.Point initP, int dist, int angle)
initP
- reference pointdist
- distance from the reference point to the desired pointangle
- angle from the reference point to the desired point
public static java.awt.Point calcDistPoint(java.awt.Point initP, int dist, int angle)
initP
- reference pointdist
- distance from the reference point to the desired pointangle
- angle from the reference point to the desired point
public static int calcAngle(java.awt.Point p1, java.awt.Point p2)
p1
- First pointp2
- Second point
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |