Post Reply 
(49g 50g) Shoelace algorithm
08-24-2018, 01:40 PM
Post: #6
RE: ( HP49/50) Shoelace algorithm
(08-23-2018 09:49 PM)Albert Chan Wrote:  I thought "UNROT * UNROT *" leave only 2 values on stack.
If true, "SWAP -" is the same as "-" with opposite sign.

Opposite sign should not matter:

2*area = abs(sum([x1*y2 - x2*y1, x2*y3 - x3*y2, ...])) = abs(sum([x2*y1 - x1*y2, x3*y2 - x2*y3, ...]))

Apparently you are correct! I tried several sets of coordinates and got the correct answer without the SWAP each time.
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: ( HP49/50) Shoelace algorithm - John Keith - 08-24-2018 01:40 PM



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