Equilateral Triangles

Mike Bonner bonnmike at gmail.com
Thu Jun 18 08:41:29 EDT 2015


I have a feature request.. Add the points property to regular polygons.
They don't need to be settable, but then you can easily find the centroid
of say.. a triangle   x1 + x2 + x3 / 3 = the x centroid of the triangle. y1
+ y2 + y3 / 3 = the y centroid of the triangle.  ( you could of course use
other methods to draw the triangle, but using a regular would be SO nice)
At that point, the y centroid - y1 (the top of the triangle) * 2 gives the
side length of the square, then set the loc of the square to
xcentroid,ycentroid.

Or, use the KCL method and just get the length of the base of the triangle
* 1.15 to get the length of the squares sides, and use triangle coords to
position the square. Position by finding the centroid as above, or use the
alignment controls in the inspector, or set the top of the square to the
top of the triangle, and the x of the loc of the square to x of the loc of
the triangle.

On Thu, Jun 18, 2015 at 1:34 AM, Kay C Lan <lan.kc.macmail at gmail.com> wrote:

> What I should have said:
>
> If you already have the triangle images, and they have no margin, so a 200
> pixel triangle should be a rectangular image 174 pixel tall and 200 pixels
> wide, then adding a 7.5% margin to the left AND right of the image (15 %
> total) and a 32% margin to the bottom, should result in a square image with
> the triangle centre in the centre of the image.
>
> GraphicConverter can apply such margins to a batch of images quicly and
> easily
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list