Hello @Darryl Meister,
Thanks for your your sagitta formula for R-P. For a programmer (not an optometrist) like me, some terminology is difficult to grasp intuitively. Maybe I can add something usefull to this thread.. your remark..
Originally Posted by
Darryl Meister
Nor could you use the Pythagorean theorem to determine the radius at any point using the X and Y coordinates (you actually use calculus).
Indeed, I use the following Pascal procedure for that.. It takes three subsequent x,y points from the result polynome, it yields the midpoint (xc,yc), maybe forum members can use this too.
PHP Code:
function SOLVE_2r(a,b,c,d,e,f: real; var x,y: real) : boolean;
var t: real;
begin
t:= (b*d - e*a);
if ((t>-1e-14) and (t<1e-14)) then begin SOLVE_2r:=false; exit; end;
x:= (b*f - e*c)/t;
y:= (a*f - d*c)/(-t);
SOLVE_2r:=true;
end;
function find_arc_center(x1,y1,x2,y2,x3,y3: real; var xc,yc: double): boolean;
// Given three points (x1,y1) (x2,y2) (x3,y3) determine arc center (xc,yc)
var a,b,c,d,e,f,x,y: real;
begin
find_arc_center:=false;
a := x3 - x1; b := y3 - y1; c := (x3*x3 + y3*y3 - x1*x1 - y1*y1)/2.0;
d := x3 - x2; e := y3 - y2; f := (x3*x3 + y3*y3 - x2*x2 - y2*y2)/2.0;
if SOLVE_2r(a,b,c,d,e,f,x,y) then
begin
xc:=x; yc:=y;
find_arc_center:=true
end;
end;
Kind regards,
:)
Lex
Bookmarks