0

What I want to do is make my mouse move in a circular fashion around a point (500px away from said point). I want the mouse to do this anticlockwise.

So what I am trying to say is this.. I want the mouse to move around a point 500px away, using the Robot class method mouseMove. I jsut can't figure out how I would do so in the math side of things.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Duncan Palmer
  • 2,865
  • 11
  • 63
  • 91
  • I am pretty sure you mean the mouse pointer. The mouse itself is outside the java virutal machine. – emory Aug 12 '12 at 12:30

2 Answers2

1

use the circle equation to get the dependence between the x value and the y value.

now go over every x between -500 to 500 (jumps of 1), calculate the y value, and move the mouse.

elyashiv
  • 3,623
  • 2
  • 29
  • 52
0

I think little bit trigonometry can do the magic. Then you can move continuously by:

Robot r = new Robot();
r.mouseMove(calculatedX,calculatedY);
HRgiger
  • 2,750
  • 26
  • 37