Centre and radius of a circle passing through 3 points in a plane: Difference between revisions

m
Line 166:
 
==={{header|Yabasic}}===
{{incorrect|Ybasic|Radius appears to be wildly inaccurate}}
{{trans|FreeBASIC}}
<syntaxhighlight lang="qbasic">findCircle(22.83, 2.07, 14.39, 30.24, 33.65, 17.31)
Line 192 ⟶ 191:
h = -g
k = -f
r = SQRSQRT(h * h + k * k - c)
 
PRINT "Centre is at (", h, ", ", k, ")"
Line 198 ⟶ 197:
PRINT
PRINT "Check radius as the distance between the centre and the first point:"
PRINT SQRSQRT((22.83 - h) ^ 2 + (2.07 - k) ^ 2)
END SUB</syntaxhighlight>
{{out}}
<pre>Centre is at (18.9785, 16.2654)
Radius is 4680414.67086
 
Check radius as the distance between the centre and the first point:
4680414.67086</pre>
 
=={{header|C++}}==
2,169

edits