in my app, I let user touch and move to draw an arc. After drawing, I got a set of points. Is there any way to determine that user draw the arc counterclockwise or reverse counter clock wise?
Asked
Active
Viewed 780 times
1
-
"reverse counter clock wise" - i.e., clockwise :) By the way, a fun word for counterclockwise is "widdershins" (the counterpart for clockwise is "deosil"). See this English.SE thread. – Zev Chonoles May 30 '13 at 07:30
2 Answers
1
If it is indeed a circle you need only find an expression in a form that defines an angle $\theta$ between the initial point and later points.
Once you've got that angle check if $\tan \frac{1}{4}\theta$ is increasing. If it is, it is moving counter clockwise.
Note this only works for angles between $0$ and $2 \pi$
kinbiko
- 412
- 5
- 15
-
+1, What do you mean about
check if tan14θ is increasing? Could you please give me more details or example? – Nguyen Minh Binh May 30 '13 at 15:23
0
The set of points will obviously be stored in an order. Circular array/list or even a plain array. Just compare the coordinates of consecutive points.
Suzuka
- 1