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

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -