# How can I plot a simple circle not centered at the origin? example: (x-5)^2+(y-10)^2=4

16 views (last 30 days)

Show older comments

##### 0 Comments

### Accepted Answer

Amit
on 31 Jan 2014

Edited: Amit
on 31 Jan 2014

You make a function for plotting the circle, something like this:

EDIT:

function plotcircle(x1,y1,r,c)

% x1,y1: center

% r = radius

theta = 0:0.05:2*pi;

hold on;

plot(x1+r*cos(theta),y1+r*sin(theta),c);

axis equal;

For for every circle, you can call this function: like

plotcircle(5,10,2,'r');

##### 6 Comments

### More Answers (1)

Image Analyst
on 31 Jan 2014

##### 5 Comments

Image Analyst
on 31 Jan 2014

Amit
on 31 Jan 2014

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!