comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: circles
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: circles [message #9513 is a reply to message #9512] Thu, 10 July 1997 00:00 Go to previous messageGo to previous message
Joseph M Zawodny is currently offline  Joseph M Zawodny
Messages: 24
Registered: March 1996
Junior Member
lady of the elves wrote:
>
> [incidentally, I'm new to this language :)]
>
> I'm trying to create a two-dimensional array, such that tvscl of the
> array will show a filled circle. So far, my best idea has not
> worked--but here it is:
>
> x and y are one-D arrays of 200 elements such that plot,x,y produces a
> circular shape, but not filled.
>
> for round1=0,199 do begin
> for round2=0,199 do begin
> if (y(round1) eq y(round2)) then begin
> circle(y(round1),x(round1):x(round2))=2
> endif
> endfor
> endfor
>
> A circle is composed of boundary points such that: for each x, there are
> two y's and for each y, there are two x's--right? If I fill between the
> y's, I should have a circle....right?
>
> I would really like to have a circularly-filled array; if anyone has
> better knowledge, please let me know :)
> Thanks.
> -gzb

Select the center coordinates (xc,yc) for the circle in pixels (these
need not be integers). If your array is (201,201) and you want the
circle centered set the center values each to 100.

Select the raduis of the circle in pixels (again, need not be integer).

For every element in the array (x,y) check to see if
((x-xc)^2)+(y-yc)^2) is less than or equal to the radius.

If it is, then set it to the "filled" value.

Naturally, this process can be done without loops.

Have fun,

JMZ



--

Work: Dr. Joseph M. Zawodny Play: Joe Zawodny
NASA Langley Research Center KO4LW@amsat.org
E-mail: J.M.Zawodny@LaRC.NASA.gov zawodny@exis.net
(757) 864-2681 (757) 864-2671 FAX http://wwwp.exis.net/~zawodny
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: .Free Cash Grants
Next Topic: Are IDL functions callable from C++ programs under Win-NT

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 10:39:47 PST 2025

Total time taken to generate the page: 0.00251 seconds