Post Reply 
(49g 50g) Shoelace algorithm
02-28-2019, 04:26 AM
Post: #20
RE: (49g 50g) Shoelace algorithm
(08-24-2018 03:56 AM)Thomas Klemm Wrote:  There might be better ways to rotate the elements of ys left and right.

(xs ys -- area)
Code:
« DUP SIZE → xs ys s
  « ys OBJ→ ROLLD s → LIST
    ys OBJ→ ROLL s →LIST
    - xs * ΣLIST 2 /
  »
»

I've read somewhere that it's faster to do the rotation on the stack.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(49g 50g) Shoelace algorithm - John Keith - 08-23-2018, 02:20 PM
RE: (49g 50g) Shoelace algorithm - Thomas Klemm - 02-28-2019 04:26 AM



User(s) browsing this thread: 1 Guest(s)