public Polar(Polar p) { init(); length = p.length; angle = p.angle; origin = new Point(p.origin); rect = new Point(p.getRect()); }
public Polar() { init(); length = 0; angle = 0; origin = new Point(0, 0); setRect(); }
public Polar(int x, int y, int r, int theta) { init(); length = r; angle = theta; normalizeAngle(); origin = new Point(x, y); setRect(); }
public Polar(Point center, Point coord) { init(); int dx = coord.x - center.x; int dy = coord.y - center.y; if (dx == 0 && dy == 0) { angle = 0; length = 0; } else { length = (int) Math.sqrt((dx * dx) + (dy * dy)); angle = toDegrees(Math.atan2((double) dy, (double) dx)); } origin = center; setRect(); }