Anonymous user
Bitmap/Bézier curves/Cubic: Difference between revisions
no edit summary
m (→{{header|C}}) |
No edit summary |
||
Line 1:
{{task|Raster graphics operations}}
Using the data storage type defined [[Basic_bitmap_storage|on this page]] for raster images, and the <
([http://en.wikipedia.org/wiki/Bezier_curves#Cubic_B.C3.A9zier_curves definition on Wikipedia]).
=={{header|Ada}}==
<lang ada>
procedure Cubic_Bezier
( Picture : in out Image;
Line 31:
end loop;
end Cubic_Bezier;
</
The following test
<lang ada>
X : Image (1..16, 1..16);
begin
Line 39:
Cubic_Bezier (X, (16, 1), (1, 4), (3, 16), (15, 11), Black);
Print (X);
</
should produce output:
<pre>
Line 118:
=={{header|OCaml}}==
<lang ocaml>let cubic_bezier ~img ~color
~p1:(_x1, _y1)
~p2:(_x2, _y2)
Line 167:
in
by_pair pts (fun p0 p1 -> line ~p0 ~p1);
;;</
|