> Given a nested list of pairs of numbers describing the points of a polygon in two dimensions, compute the area of the polygon using Gauss' area formula, also known as the shoelace formula.
(your_function) (2 4)(3 ¯8)(1 2)
7
(your_function) (1 1) ⍝ a point has no area
0
(your_function) (1 1)(2 2) ⍝ neither does a line
0
yeah feels like an over perhaps, but I see you're concatenating the first value (like in the description on the problem page) in a similar way to @RubenVerg
how can you get a single array (3D) with the contents of (0 1⊖⍵) and (1 0⊖⍵), without simply joining those two
@RubenVerg imho the only obscure part is the 2+.÷⍨ instead of 0.5×+/ or 2÷⍨+/
it also took me a minute to grok, but otherwise it's a decent algorithm - note that it's a pair-wise reduction 2F/which is not immediately obvious with all the tacit going on
2-/⍤×∘⌽/⍵ ⍝ difference of product of each point (xy) with reversed right-neighbour
So I've got: Gauss←{0.5×|-/+/×/(2 2⍴0 1 0 ¯1)⊖⍤1 99↑,⊆⍵}
@RikedyP I still don't fully get the rules for when a tacit chain stops, but I noticed that I didn't need any parens around the reduction for it to work, it's definitely much clearer with
variatio: Rhetorical principle opposed to repetition, to which many [rhetorical] figures are connected, like polyptoton and synonimy, and many more. These can be used to get a variation in speech and therefore avoiding monotony.
the roman poet Sallust is known for using variatio very often
it says "opposed to repetition", but I'm guessing the idea is you want to say the same thing again (for effect) but not literally use the same phrase again