Post Reply 
(49g 50g) Shoelace algorithm
08-24-2018, 03:27 PM (This post was last modified: 08-30-2018 10:05 PM by Albert Chan.)
Post: #8
RE: ( HP49/50) Shoelace algorithm
Is this a valid RPL program ?

\(A=\frac{1}{2}|\sum_{i=1}^{n}(x_{i+1}+x_{i})(y_{i+1}-y_{i})|\)

where \(x_{n+1}=x_{1}\) and \(y_{n+1}=y_{1}\).

(xs ys -- area)
Code:
« DUP HEAD + ΔLIST               @ do y diff
  SWAP DUP DUP HEAD + TAIL ADD   @ do x sums
  * ∑LIST ABS 2 /                @ do area
»
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 - Albert Chan - 08-24-2018 03:27 PM



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