Here's a simple explanation and then a solution :

1. The (a,b) is the center co-ordinate of the circle.

2. The (x,y) is any point on the circumference of the circle.

3. r is the radius of the circle.

4. Each Point on Circle = r*cos(angle), r*sin(angle)

Now, the MATAB code is here :

%define a, b, x and y a = 3; b = 4; x = 6; y = 7; % Now we will find radius r = (x-a)^2 + (y-b)^2; % Now we will create a vector of angle range from 0 to 2*pi theta = 0 : 0.01 : 2*pi; % Now we will find x-points and y-points xp = r * cos (theta); yp = r * sin (theta); % now we will plot the circle axis 'square' plot (xp + a, yp + b)

And you are done :

Hope that this explanation is satisfactory. Please do rate my answer and accept as answer if it solved your problem :)

With Regards

Tushar Srivastava