B-spline: Difference between revisions
Content added Content deleted
(Tidied task description a little, linked to Wikipedia article, added another (more intelligible) reference.) |
(julia example) |
||
Line 25: | Line 25: | ||
* [https://www.cl.cam.ac.uk/teaching/2000/AGraphHCI/SMEG/node4.html B-splines] |
* [https://www.cl.cam.ac.uk/teaching/2000/AGraphHCI/SMEG/node4.html B-splines] |
||
<br><br> |
<br><br> |
||
=={{header|Julia}}== |
|||
Choose BSpline D of 2, ie degree 1. |
|||
<lang julia>using Graphics, Plots |
|||
Point(t::Tuple) = Vec2(Float64(t[1]), Float64(t[2])) |
|||
const controlpoints = Point.([(171, 171), (185, 111), (202, 109), (202, 189), (328, 160), |
|||
(208, 254), (241, 330), (164,252), (69, 278), (139, 208), (72, 148), (168, 172)]) |
|||
plt = plot(map(a -> a.x, controlpoints), map(a -> a.y, controlpoints)) |
|||
savefig(plt, "BSplineplot.png") |