Hello
A short description of what im supposed to accomplish:
I have 2 inputs, one is for the area for the circle that is going to rotate around in the figure. The other one is for the distance this circle is to rotate compared to the centre(0,0) of the figure.
Here's what i've done so far but can't get my head around to figure out how to make it rotate around the centre at a set distance.
function rotateCircle(a,rotRad)close all[x,y] = meshgrid(-200:200);circleRadius = a/pi;radius = sqrt(circleRadius);cx = x;cy = y;size(cx)for j = 1:30 drawDisk(cx-rotRad,cy-rotRad,radius); cx = cx + cos(j*2*pi/30); cy = cy + sin(j*2*pi/30); mov(j) = getframe;endmovie(mov,10);end
And my helpt function:
function drawDisk(cx,cy,radius) [x,y] = meshgrid(-200:200); circleImage = (cx).^2 + (cy).^2 < radius^2; % the disk
imagesc(x(:,1),y(:,1),circleImage);
Best Answer