Points in a circular area
Jim Hurley
jhurley at infostations.com
Thu Jan 29 08:20:04 EST 2004
>
>Message: 2
>Date: Wed, 28 Jan 2004 23:36:28 -0800 (PST)
>From: Alejandro Tejada <capellan2000 at yahoo.com>
>Subject: Points in a circular area
>To: use-revolution at lists.runrev.com
>Message-ID: <20040129073628.38580.qmail at web40513.mail.yahoo.com>
>Content-Type: text/plain; charset=us-ascii
>
>Hi Developers,
>
>I'm working with geometric stuff now, and before
>reinvent the wheel, i feel compeled to ask:
>
>Do you have a function that returns all
>the points or coordinates within an arc of
>a circle?
>
>Notice for a rectangular area this is
>fairly easy, but an area with the shape of an
>slice is another thing. Imagine how to get all the
>points within a larger version of this arc shape >.
>
>Ideas or suggestions are welcome!
>
>Thanks in advance.
>
>al
Al,
I presume you mean all integer coordinates within the arc. And the
arc is a slice of pie?
This is crude, but possibly viable.
A little Turtle Graphics (with radial coordinates) might help--of course :-)
If the arc is a piece of pie: Use polar coordinates. Set the origin
at the apex of the arc. Test for all x-y integer coordinates within
a square of side R (radius of the arc) for their radial coordinates.
Accept those for which r is less than R and theta is between the arc
angles.
Is this clear without a figure?
Jim
More information about the use-livecode
mailing list