Shoelace formula for polygonal area: Difference between revisions
Content added Content deleted
(Removed useless "import math". Removed useless "$" in "echo $shoelace(points)".) |
Not a robot (talk | contribs) (Add APL) |
||
Line 189: | Line 189: | ||
30.00 |
30.00 |
||
</pre> |
</pre> |
||
=={{header|APL}}== |
|||
{{works with|Dyalog APL}} |
|||
<lang APL>shoelace ← 2÷⍨|∘(((1⊃¨⊢)+.×1⌽2⊃¨⊢)-(1⌽1⊃¨⊢)+.×2⊃¨⊢)</lang> |
|||
{{out}} |
|||
<pre> shoelace (3 4) (5 11) (12 8) (9 5) (5 6) |
|||
30</pre> |
|||
=={{header|C}}== |
=={{header|C}}== |