Points in a circular area

Alejandro Tejada capellan2000 at yahoo.com
Thu Jan 29 18:26:38 EST 2004


on Thu, 29 Jan 2004 
Dar Scott wrote:

> Some years ago I designed a model and library for
> working with abstractions of drawings and 
> paintings in a functional (that is f() 
> manner) way.
> 
> In that model the plane could be partitioned by a
> line or by a circle and other shapes.  
> A pie shape is the union (ANDing) of two line 
> partitions and a circle partition.

> For this particular case, it might be easier for you
> to arctan2 points relative to the center to see 
> if they are in the right angle range and 
> then check the distance to see if that is small
> enough.

If i interpret right your recommendations,
it's similar to the procedure that Jim Hurley
is suggesting to use. Now, i'll code a solution
and post the script for speed enhancements. ;-)

> In rendering (or creating point lists) I am trying
> to use interval arithmetic and am putting that off 
> until some performance changes in Revolution.  
> This method allows tests to work on
> whole zones of pixels in one calculation. 

This sounds useful. Could externals helps for
these tasks? 

> The line tests will be faster than the arctan2 
> tests for this method, because of the ignorance
> involved in interval arithmetic.  

I've read that assembler code is faster than c code.

> In the mean time you might try testing each pixel (I
> assume you mean pixels) in the bounding rect 
> of the circle of which the arc is part.

Let's see how much time does this calculation takes.

> I worry about whether coordinates are between pixels
> or in the middle, but I might be the only one here 
> that does.

The integer math of the screen coordinates are 
just a convenient representation of the 
"real" floating point precision of 
graphics and pixels.

Thanks a lot for your ideas, Dar!

al

=====
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


More information about the use-livecode mailing list