Plotting circle using angle and radius

71 Ansichten (letzte 30 Tage)
Robin Szabo
Robin Szabo am 7 Nov. 2018
Beantwortet: Aquatris am 7 Nov. 2018
I have some code in which I have generated a set of radii and their corresponding angles and I need to plot these as a circle. Unfortunately it creates half the circle twice and I can't find a way to plot the left (negative) side of the circle.
The picture below shows what matlab plots. I decreased the resolution to make it more blocky and so there's definitely two lines however they are both in the positive part of the circle.

Antworten (1)

Aquatris
Aquatris am 7 Nov. 2018
Next time, share your code so that we can debug your code. My guess is you angle are from +90 degrees to -90 degrees instead of 0 to 360 degrees.
Here is a simple circle code;
q = 0:0.01:2*pi; % angle 0 to 360 degrees in radian
r = 10; % radius
x = r*cos(q); % cartesian x coordinate
y = r*sin(q); % cartesian y coordinate
plot(x,y)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by