Jump to content

Circles of given radius through two points: Difference between revisions

m
m (→‎{{header|Wren}}: Minor tidy)
Line 53:
‘Following explanation at http://mathforum.org/library/drmath/view/53027.html’
I r == 0.0
X.throw Error(‘radius of zero’)
V (x1, y1) = p1
V (x2, y2) = p2
I p1 == p2
X.throw Error(‘coincident points gives infinite number of Circles’)
V (dx, dy) = (x2 - x1, y2 - y1)
V q = sqrt(dx ^ 2 + dy ^ 2)
I q > 2.0 * r
X.throw Error(‘separation of points > diameter’)
V (x3, y3) = ((x1 + x2) / 2, (y1 + y2) / 2)
V d = sqrt(r ^ 2 - (q / 2) ^ 2)
Line 123:
ERROR: radius of zero
</pre>
 
=={{header|Action!}}==
{{libheader|Action! Tool Kit}}
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.