1 Pages (4 items)
Area of irregular polygon - Messages
#1 Posted: 2/20/2015 2:54:13 PM
Hi friends,
I am newbie to Smath studio and I am trying to find area for irregular polygon. I have input the coordinates in a matrix and created a small function to find the area using coordinate geometry. But i am getting an error as the function is not evaluated. if I run the function for a square it works fine. Can somebody help me what is wrong with my function? I have attached the file for reference.
Thanks
Vivek
Page1.sm (5 KiB) downloaded 35 time(s).
I am newbie to Smath studio and I am trying to find area for irregular polygon. I have input the coordinates in a matrix and created a small function to find the area using coordinate geometry. But i am getting an error as the function is not evaluated. if I run the function for a square it works fine. Can somebody help me what is wrong with my function? I have attached the file for reference.
Thanks
Vivek
Page1.sm (5 KiB) downloaded 35 time(s).
#2 Posted: 2/20/2015 4:15:43 PM
Hello Vivsets,
I think your formula is trying to reference one more row than you need to (outside your matrix). Try rows(X)-1 in your for loop.
Gerry Bush
Page1-1.sm (5 KiB) downloaded 40 time(s).
I think your formula is trying to reference one more row than you need to (outside your matrix). Try rows(X)-1 in your for loop.
Gerry Bush
Page1-1.sm (5 KiB) downloaded 40 time(s).
#3 Posted: 2/20/2015 6:03:56 PM
If you are interested, in the Extensions Manager (Tools > Plugins > Examples [Local Storage > Online Gallery]) there is a worksheet dedicated to to polygons' properties - just to not reinvent the wheel
![2015-02-20 22_02_34-SMath Studio Desktop - [Page2.sm].png](/en-US/file/XNkege/2015-02-20-22_02_34-SMath-Studio-Desktop---_Page2_sm__png)

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Posted: 2/20/2015 7:36:54 PM
Thanks Gerry and Davide for your replies.
Gerry I fixed the function based on your answer and it works fine.
Davide your example sheet is awesome. You are right there is no point in reinventing the wheel. I will go through it in detail and put it in use in my future development of sheets.
Gerry I fixed the function based on your answer and it works fine.
Davide your example sheet is awesome. You are right there is no point in reinventing the wheel. I will go through it in detail and put it in use in my future development of sheets.
1 Pages (4 items)
-
New Posts
-
No New Posts