(x-2)^2 + y^2 = 4
that is a circle who has a center at 2,0 and a radius of 2.
I need to graph that in MATLAB
but i do not know how..
i keep getting a parabola..
please help
that is a circle who has a center at 2,0 and a radius of 2.
I need to graph that in MATLAB
but i do not know how..
i keep getting a parabola..
please help
-
When you solve the equation for y, you get the following
y = sqrt(4 - (x - 2)^2)
So, y can have both positive and negative values (remember that the square of a negative number is a positive value).
So, the easiest way to execute the plot is to use a command like
plot(x,y,x,-y)
y = sqrt(4 - (x - 2)^2)
So, y can have both positive and negative values (remember that the square of a negative number is a positive value).
So, the easiest way to execute the plot is to use a command like
plot(x,y,x,-y)