Sierpinski arrowhead curve: Difference between revisions
Content deleted Content added
Added Algol 68 |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 125:
Generates an SVG file containing the curve using the L-System. Very similar to the Algol 68 Sierpinski square curve sample. Note the Algol 68 L-System library source code is on a separate page on Rosetta Code - follow the above link and then to the Talk page.
<syntaxhighlight lang="algol68">
BEGIN # Sierpinski Arrowhead Curve in SVG
# uses the RC Algol 68 L-System library for the L-System evaluation & #
# interpretation #
Line 168 ⟶ 167:
STRING curve = ssc EVAL order;
curve INTERPRET ( ( CHAR c )VOID:
IF c = "F
x +:= length * cos( angle * pi / 180 );
y +:= length * sin( angle * pi / 180 );
Line 691 ⟶ 690:
=={{header|EasyLang}}==
[https://easylang.
<syntaxhighlight
x = 5
y = 10
Line 939 ⟶ 938:
Windowtitle "Hit any key to end program"
Sleep</syntaxhighlight>
=={{header|Fōrmulæ}}==
{{FormulaeEntry|page=https://formulae.org/?script=examples/L-system}}
'''Solution'''
It can be done using an [[wp:L-system|L-system]]. There are generic functions written in Fōrmulæ to compute an L-system in the page [[L-system#Fōrmulæ | L-system]].
The program that creates a Sierpiński arrowhead is:
[[File:Fōrmulæ - L-system - Sierpiński triangle (rounded) 01.png]]
[[File:Fōrmulæ - L-system - Sierpiński triangle (rounded) 02.png]]
=={{header|Go}}==
|