How to draw consecutive circles?

k = 7. ;
N = 255 ;
x = 0:N ;
y = 0:N ;
[X,Y] = meshgrid(x,y) ;
I = 1/2*(1+sin(2*pi/N*k*X)) ;
imshow(I)

 Accepted Answer

DGM
DGM on 17 Nov 2021
Edited: DGM on 17 Nov 2021
Here's an example. You'll need to adjust it for the number of cycles you want. I'm going to replicate the original image.
s = 512; % image size (assumed square)
n = 4.5; % number of cycles from center to corner
xm = n*sqrt(2)*pi; % figure out what the extents are
x = linspace(-xm,xm,s);
r = sqrt(x.^2 + x.'.^2);
M = im2uint8(0.5 - cos(r)/2);
imshow(M)

1 Comment

Thank you very much for your accurate guidance.

Sign in to comment.

More Answers (0)

Tags

Asked:

on 16 Nov 2021

Edited:

DGM
on 17 Nov 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!