[SOLVED] Simple Trig Thing
I'm trying to make a method that finds the angle (in degrees) of the line between two points. It's been a while since I've taken trig, so I looked up some stuff... but honestly, I don't think I got it right. This is what I tried to do, but it isn't working.
public void mouseReleased(MouseEvent event)
bullets.add(new Item(X, Y, 5, 5, 50, getAngle(X, Y, event.getX(), event.getY())));
public int getAngle(int x1, int y1, int x2, int y2)
int a = (int)Math.toDegrees(Math.atan(Math.toRadians((y2-y1)/(x2-x1))));