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

Home » Public Forums » archive » disk with hole
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: disk with hole [message #56828 is a reply to message #56740] Wed, 14 November 2007 08:08 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"jochem.verelst@gmail.com" <jochem.verelst@gmail.com> writes:

> Hi IDL gurus,
>
> Has anybody an idea on how to create a disk with hole? So to say, it
> is a circle within another circle and that surface should be filled.
> Thanks to the great website of DF drawing 2 cricles is the easy part.
> But filling the space in between seems to be the hard part. Anyone can
> guide me further?

It's not that hard if you approximate a circle with a polygon.

IDL> th = dindgen(1001)*2d*!dpi/1000d
IDL> c = cos(th) & s = sin(th)
IDL> r1 = 1d & r2 = 2d
IDL> x = [r1*c, r2*reverse(c)]
IDL> y = [r1*s, r2*reverse(s)]

IDL> plot, [-5,5], [-5,5], /nodata
IDL> polyfill, x, y

Also, I think there's nothing stopping you from making this the
USERSYM, and then overplotting it to your heart's content.

Good luck!
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Calling f90 subroutine from IDL
Next Topic: Re: NaN Magic or Why Me?!

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

Current Time: Fri Oct 10 10:21:31 PDT 2025

Total time taken to generate the page: 0.87988 seconds