ios - Constraining motion inside a circle -
looking direction on this. have ring of radius r. inside ring have circle of radius c, c < r. want user able grab inner circle , move/throw it, circle should constrained stay inside ring. suggestions on following?
- handling touch events
- the math involved constrain view circle?
i working in ios, concept general.
not sure mean "handling touch events", here's math:
hypot(circle.center.y - ring.center.y, circle.center.x - ring.center.x) < (r - c)
Comments
Post a Comment