Circles of given radius through two points: Difference between revisions
Circles of given radius through two points (view source)
Revision as of 09:04, 7 April 2024
, 2 months ago→{{header|11l}}: X.throw
m (→{{header|Wren}}: Minor tidy) |
Alextretyak (talk | contribs) m (→{{header|11l}}: X.throw) |
||
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}}
|