Russ P. answered 11/11/14
Tutor
4.9
(135)
Patient MIT Grad For Math and Science Tutoring
Gary,
Let's do the most general case where the cord is not parallel to either the x or y axes. Then,
Let Ux & Uy = the unit vectors along the x and y axes.
(Xk,Yk) = the beginning and end coordinates of the straight line chord of the arc (k = 1 & 2)
(Xa, Ya) = any point on the curving arc (not assumed to be part of a circle necessarily).
s = the distance of (Xa,Ya) from (X1,Y1)
h = the distance from (Xa,Ya) to the chord line along the perpendicular to the chord.
φ = the angle at (X1,Y1) between the vector to the point on the arc and the vector of the chord line
Now you have a right triangle formed with these relationships:
s = √[(Xa - X1)2 + (Ya - Y1)2] along its hypotenuse
h = (s) Sinφ
and Cosφ is determined using the dot product of two vectors:
Vector A = (Xa-X1)Ux + (Ya-Y1)Uy is the vector from chord Pt#1 to the general point on the arc
Vector C = (X2-X1)Ux + (Y2-Y1)Uy is the vector from chord Pt#1 to chord Pt#2
A dot C = |A| |C| Cosφ
{(Xa-X1) (X2-X1) + (Ya-Y1) (Y2-Y1)} = {√[(Xa-X1)2 + (Ya-Y1)2]}{√[(X2-X1)2 + (Y2-Y1)2]}Cosφ,
All these values are known, so solve for the angle φ and find h = (s) Sinφ since s is also known.