The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 area of a polygon
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

georockpat

USA
Posts

Posted - 01/03/2006 :  07:05:20 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0
Operating System:Windows

How do you use origin to calculate the area of a polygon created witht the polygon tool?

Laurie

USA
404 Posts

Posted - 01/03/2006 :  4:07:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You'll have to do this with a script.

Search on "User-created Visual Objects" in the Programming Help, opened by selecting Help:Programming. You can use the width and height (in axes units) properties: dx and dy

For example, to find the area of a triangle, whose name is polygon:

area=1/2*polygon.dx*polygon.dy;
area=;
AREA=2.591236

Note: To open the Script Window, select Window:Script Window. And then enter the above first two lines; the third line will be returned as a result.

OriginLab Technical Support
Go to Top of Page

georockpat

USA
Posts

Posted - 01/06/2006 :  02:14:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What about randomly shaped polygons? Shapes without formulas. Is there a known way to count pixels bound within the polygon? I am attempting to compare the areas of regions bound by a curve. The shapes of the areas can be outlined with the polygon tool, but I do not know how to calculate the area of the region inside the polygon.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/06/2006 :  08:45:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The only additional information available for the polygon are the coordinates of its corners...

polygon.x1=; polygon.y1=; // 1st corner
polygon.x2=; polygon.y2=; // 2nd corner
polygon.x$(n)=; polygon.y$(n)=; // nth corner

It's up to you to use those coordinates to obtain the area.

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000