Is there a function available in Silverfrost Fortran to calculate the center and radius of a circle with 3 x,y,z coordinates on the circumference? Sid Kraft
Circle 3D
Sid,
This is a fairly easy calculation ( which I have not done for many years !)
For the line between two points on the circumference, it can be written as: l1.x + m1.y + n1 = 0 ( solve for l1,m1,n1) (Function line_between_two_points)
the normal to this line, that passes through the mid point on the line, also goes through the centre of the circle, which is: m1.x - l1.y + k1 = 0 ( solve for k1 ) (Function line_through_one_point)
similarly for points 2 and 3 (or 1 and 3); solve for l2,m2,n2 then k2
Then find the intersection of lines (m1,-l1,k1) and (m2,-l2,k2), testing for edge conditions, when m1 or m2 are zero. ( the lines can not be parallel ! ) (Function intersect_two_lines) All you need is the inverse of a 2x2 matrix !
An easy calculation that can be captured in a subroutine
John
I think that Sid probably means a sphere.
Sid
There is no such function provided but Google AI will tell you how to go about writing your own function.