I'm creating an interface control in an iPhone app where views are positioned in an arc, corresponding to the X touch position. I need to write a function that, given an X value, returns the Y value that corresponds to the red line on the graph below:
I will be defining points A, B, and radius r to control the amount of curve. Point A will always be at 12 o'clock (greater Y value than point B). My math (especially with circles) is a little rusty… what formulas do I need to write this function? An example to accompany any formula(s) would be helpful. Thanks!
Edit: Function should return ABS(Y)