hello

,

I search how to obtain degree information from two location of point in my applet for ordinal direction for sprite .

I trie :

public class Angle {

int pointOneX = 100; // ->

int pointOneY = 100; // v

int pointTwoX = 90; // ->

int pointTwoY = 58; // v

double distanceX = 0;

double distanceY = 0;

double distance = 0;

public Angle() {

calculDistance();

calculAngle();

}

private void calculDistance() {

distanceX = pointTwoX - pointOneX;

distanceY = pointTwoY - pointOneY;

distance = Math.sqrt(distanceX * distanceX + distanceY * distanceY);

}

private void calculAngle() {

double startAngle = (int)Math.toDegrees(Math.asin(distanceY / distance));

System.out.println(" startAngle : " + startAngle);

}

public static void main(String[] args) {

new Angle();

}

}

but the result is not very helpfull.

have you a solution ? thank you very much