Area of irregular polygon

Area of irregular polygon - Messages

#1 Posted: 2/20/2015 2:54:13 PM
vivsets

vivsets

0 likes in 2 posts.

Group: User

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).
#2 Posted: 2/20/2015 4:15:43 PM
Gerry_Bush

Gerry_Bush

12 likes in 14 posts.

Group: User

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).
#3 Posted: 2/20/2015 6:03:56 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

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
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
vivsets

vivsets

0 likes in 2 posts.

Group: User

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.

  • New Posts New Posts
  • No New Posts No New Posts