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?

  1. handling touch events
  2. 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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -