Superellipse: Difference between revisions

m
(add lambdatalk code)
Line 843:
}}}
-> superellipse
</syntaxhighlight>
 
We use SVG and the lib_plot library defining the SVG, AXES, stroke functions to draw four superellipses, a circle, a rounded square (as required), a square and an astroid.
 
<syntaxhighlight lang="scheme">
{{SVG 600 600}
{g {AXES 600 600}
{polyline
{@ points="{S.map {lambda {:i} {superellipse 200 2.5 :i} }{S.serie -1 1.01 0.01}}"
{S.serie -1 1.01 0.01}}"
{stroke #f00 4}}}
{polyline
{@ points="{S.map {lambda {:i} {superellipse 200 0.5 :i} }{S.serie -1 1.01 0.01}}"
{S.serie -1 1.01 0.01}}"
{stroke #0f0 4}}}
{polyline
{@ points="{S.map {lambdasuperellipse {:i200 1} {superellipseS.serie 200-1 1.01 :i0.01} } "
{S.serie -1 1.01 0.01}}"
{stroke #888 2}}}
{polyline
{@ points="{S.map {lambdasuperellipse {:i200 2} {superellipseS.serie 200-1 21.01 :i0.01} } "
{S.serie -1 1.01 0.01}}"
{stroke #888 2}}}
}}
99

edits