Beispiel #1
0
 public Polar(int x, int y, int r, int theta) {
   init();
   length = r;
   angle = theta;
   normalizeAngle();
   origin = new Point(x, y);
   setRect();
 }
Beispiel #2
0
 public void setAngle(int val) {
   angle = val;
   normalizeAngle();
   rect = null;
 }
Beispiel #3
0
 public void addAngle(int val) {
   angle += val;
   normalizeAngle();
   rect = null;
 }
Beispiel #4
0
 private Point getPoint() {
   normalizeAngle();
   int x = ((int) ((double) length * cos[angle])) + origin.x;
   int y = ((int) ((double) length * sin[angle])) + origin.y;
   return new Point(x, y);
 }