Jump to content

Curve that touches three points: Difference between revisions

m
m (→‎{{header|Perl}}: inline image)
Line 327:
 
=={{header|Julia}}==
To make things more specific, findthe example below finds the circle determined by the points. The curve is then the arc between the 3 points.
<syntaxhighlight lang="julia">using MakiePlots
 
struct Point; x::Float64; y::Float64; end
Line 353:
x = a-r:0.25:a+r
y0 = sqrt.(r^2 .- (x .- a).^2)
sceneplt = linesplot(x, y0 .+ b, color = :red)
linesplot!(scene, x, b .- y0, color = :red)
scatter!(scene, [p.x for p in allp], [p.y for p in allp], markersize = r / 10)
</syntaxhighlight>{{out}}
<pre>
The circle with center at x = 105.0, y = 81.31578947368422 and radius 118.78948534384199.
</pre>
[[File:Circle3points.png]]
 
=={{header|Lambdatalk}}==
4,105

edits

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