Message Boards Message Boards

1
|
3314 Views
|
5 Replies
|
10 Total Likes
View groups...
Share
Share this post:

improved Disk[] function by including a radial range

Posted 10 years ago
POSTED BY: Jihad AlSadah
5 Replies

Found it!

ParametricPlot[r {Cos[t], Sin[t]}, {r, 2.1, 2.5}, {t, 0, Pi}]

Thanks again, JH

POSTED BY: Jihad AlSadah

Thank you, JH

POSTED BY: Jihad AlSadah

Hello, Give it a try... It should be pretty fast for about 2^8 disks.... WCC

POSTED BY: W. Craig Carter

Hello,

So, you hide part of a full disk by a smaller disk with background color. This should work for a small number of disks.

However, for a graphical project that uses 2^3 or 2^4 such segments it becomes too taxi this way.

RegionPlot does the job but it is slow to compute. I think that the function Disk could use a new improvement.

Thank you, JH

POSTED BY: Jihad AlSadah

Hello, How about something like this:

annulus[point : {x_, y_}, radii : {ri_, ro_}, color_: Black] := 
 Graphics[
  GraphicsGroup[{color, Disk[point, ro], White, Disk[point, ri]}]
]

e.g.,

annulus[{1, 2}, {3, 5}]
annulus[{1, 6}, {4, 4.2}, Yellow]

This assumes that the background is white. You would need to use Show[] to combine it with other graphics. You could modify this to use limits for theta as well.

POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract