Circles of given radius through two points: Difference between revisions
Circles of given radius through two points (view source)
Revision as of 02:22, 22 February 2023
, 1 year agoFixed error where addition was used instead of subtraction.
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
(Fixed error where addition was used instead of subtraction.) |
||
Line 657:
if(half_distance > r) return std::make_tuple(NONE, ans1, ans2);
if(half_distance - r == 0) return std::make_tuple(ONE_DIAMETER, center, ans2);
double root =
ans1.x = center.x + root * (p1.y - p2.y);
ans1.y = center.y + root * (p2.x - p1.x);
Line 702:
Only one solution: 0.1234 0.9876
</pre>
=={{header|D}}==
{{trans|Python}}
|