Circles of given radius through two points: Difference between revisions

Fixed 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 = std::hypotsqrt(pow(r, 2.l) - pow(half_distance, 2.l)) / distance(p1, p2);
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}}
2

edits