Shoelace formula for polygonal area: Difference between revisions
Content added Content deleted
m (→Python: Defined in terms of reduce and cycle: Section title amended by its original author) |
|||
Line 1,371: | Line 1,371: | ||
</lang> |
</lang> |
||
===Python: |
===Python: Defined in terms of reduce and cycle=== |
||
Or, defined in terms of '''reduce''' and '''cycle''': |
|||
{{Trans|Haskell}} |
{{Trans|Haskell}} |
||
{{Works with|Python|3.7}} |
{{Works with|Python|3.7}} |
||
Line 1,418: | Line 1,417: | ||
<pre>Polygonal area by shoelace formula: |
<pre>Polygonal area by shoelace formula: |
||
[(3, 4), (5, 11), (12, 8), (9, 5), (5, 6)] -> 30.0</pre> |
[(3, 4), (5, 11), (12, 8), (9, 5), (5, 6)] -> 30.0</pre> |
||
===Python: Alternate=== |
===Python: Alternate=== |