Area of regular polygon triangles

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Area of regular polygon triangles

Tore Nilsen via use-livecode
If a regular polygon has 4 or 8 sides it seems to be inscribed so that all points touch the square defined by the object’s height and width, which means that it should be fairly easy to deduce the polygon’s area.  
But with 3 sides, the triangle appears slightly smaller than the maximum size that could fit into that square.  Is there some math that would give me the area of that triangle from the height and width of the square (i.e., the official height and width of the polygon object)?
David Epstein
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Area of regular polygon triangles

Tore Nilsen via use-livecode
If you need to use the box method, and the control rect isn't perfect,  it
might be easier to create the rect on your own.  Go through the points and
find the topmost, left most, rightmost, bottom most coordinates and that
gives you your box.  Alternatively, if you just want the area and don't
care how you get it the equation is pretty straightforward.

area
=
A
x
(
B
y

C
y
)
+
B
x
(
C
y

A
y
)
+
C
x
(
A
y

B
y
)
2
where Ax and Ay are the x and y coordinates of the point A etc..   I have a
stack that does this while dragging points around, it works well enough.

On Wed, Jun 6, 2018 at 5:14 PM, David Epstein via use-livecode <
[hidden email]> wrote:

> If a regular polygon has 4 or 8 sides it seems to be inscribed so that all
> points touch the square defined by the object’s height and width, which
> means that it should be fairly easy to deduce the polygon’s area.
> But with 3 sides, the triangle appears slightly smaller than the maximum
> size that could fit into that square.  Is there some math that would give
> me the area of that triangle from the height and width of the square (i.e.,
> the official height and width of the polygon object)?
> David Epstein
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Area of regular polygon triangles

Tore Nilsen via use-livecode
In reply to this post by Tore Nilsen via use-livecode
While trying Mike Bonner's suggestion of "manual" measuring, I learned the answer:  a regular polygon whose official length is L and width is W is inscribed in the oval whose length is L and width is W.  So for an equilateral triangle the area will be 3/4 * 3^.5 * R^2 (where R = L = W).

David Epstein
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Area of regular polygon triangles

Tore Nilsen via use-livecode
Cool!

On Thu, Jun 7, 2018 at 5:08 PM, David Epstein via use-livecode <
[hidden email]> wrote:

> While trying Mike Bonner's suggestion of "manual" measuring, I learned the
> answer:  a regular polygon whose official length is L and width is W is
> inscribed in the oval whose length is L and width is W.  So for an
> equilateral triangle the area will be 3/4 * 3^.5 * R^2 (where R = L = W).
>
> David Epstein
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode