MATLAB: How to add a circle to this..

centrecirclelearning

I just started learning mathlab and I wanted to plot a circle on this figure.. more like a car. please how do i do it.. x=[0,0,1,2,3,4,5,5,0] y=[0,1,1,2,2,1,1,0,0]. Thank you

Best Answer

Let the center of circle be (a,b) and radius be 'r'. Use parametric equations of circle.
x = a+r*cos(theta) ; y = b+r*sin(theta) ;
You have to define theta into a array.
use hold on ;
plot(x,y,'r') ;
this will plot circle on the given plot.
Related Question