Marching squares: Difference between revisions
Content added Content deleted
m (Python example) |
|||
Line 43: | Line 43: | ||
[0, 0, 0, 0, 0] |
[0, 0, 0, 0, 0] |
||
]) |
]) |
||
def transform(xy, xmax): |
|||
x, y = xy |
|||
return (y, xmax - x) |
|||
# Find contours at a constant value of 0.1 and extract the first one found |
# Find contours at a constant value of 0.1 and extract the first one found |
||
Line 55: | Line 51: | ||
[ (3.0, 1.0), (2.0, 2.0), (2.0, 2.0), (1.0, 3.0), (1.0, 4.0), (2.0, 5.0), (3.0, 5.0), (4.0, 4.0), (4.0, 3.0), (4.0, 2.0), (3.0, 1.0) ] |
[ (3.0, 1.0), (2.0, 2.0), (2.0, 2.0), (1.0, 3.0), (1.0, 4.0), (2.0, 5.0), (3.0, 5.0), (4.0, 4.0), (4.0, 3.0), (4.0, 2.0), (3.0, 1.0) ] |
||
</pre> |
</pre> |
||
=={{header|Wren}}== |
=={{header|Wren}}== |