Post Reply 
(15C) Area and Perimeter of irregular polygon
12-05-2023, 12:53 PM
Post: #2
RE: (15C) Area and Perimeter of irregular polygon
There's an error in the Area formula (not in the program): the first term also needs a minus sign.
If the area is all you need, you may try this small program (concocted on the fly ;-)
Enter the coefficients in any matrix, recall the matrix to the stack and (GSB) A.

 33 Bytes

                   X       Y       Z       T
001 LBL A
002 STO I
003 MATRIX 1
004uRCL (i)
005 RCL 0          dummy
006 0
007uRCL (i)
008 LBL 1
009 GSB 0
010uRCL (i)        yj      A       xj      xj
011 GTO 1
012 GSB 0
013 ABS
014 2
015 /
016 RTN
017 LBL 0          yi      A               xi
018 R^             xi      yi      A
019uRCL (i)
020 +              xi+xj   yi      A       A
021 X<>Y
022 LASTX
023 Rv             yi      xi+xj   A       xj
024 RCL- (i)
025 x
026 +
027 RTN


Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (15C) Area and Perimeter of irregular polygon - Werner - 12-05-2023 12:53 PM



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