# interesting problem - help !!

This topic is 5095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hi all, i've an interesting problem to be solved - i've described my solution also but would like to hear if therez a simple one to that. here is the problem, Within a circle, find whether a moving pt. has passed the target pt.; moving pt. can either rotate in anti-clockwise (+ve rotation) or clockwise (-ve rotation). but it is given that the moving pt. is always to the left of target pt. during +ve rotation and it is to the right of target pt. during -ve rotation when viewed from outside the circle. solution:: if (+ve rotation) { assume the target is always 2pi; if (initial target is 2Pi or 0 ) { untouch the moving pt.; } else { displace the moving pt. by targetPt. value; // if target is in 1st quadrant & moving pt. in 4th quadrant if (moving pt. < 0) { moving pt. += 2Pi;} } if (moving pt. > 360) { moving pt. passed target pt. } } else if (-ve rotation) { do the other way with target value assumed to 0.... } appreciate ur inputs.... .kavitha

##### Share on other sites
Can you explain it better? What "target pt" does? Just stay?

##### Share on other sites
target pt. is just a fixed pt. on the circle !!

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 10
• 9
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
633682
• Total Posts
3013308
×