plotting cardioid and circle in one graph

26 visualizaciones (últimos 30 días)
amanina abdul rahman
amanina abdul rahman el 27 de Nov. de 2015
Comentada: Raj el 20 de Mzo. de 2023
hi. how do i plot the cardioid and the circle in one graph? here's the equation of cardioid=1+cos(t) and cirle=3*cos(t).

Respuestas (2)

Thorsten
Thorsten el 27 de Nov. de 2015
Editada: Thorsten el 27 de Nov. de 2015
Use polar
theta = linspace(0, 2*pi);
polar(theta, 1+cos(theta))
hold on
polar(theta, 3*cos(theta), 'r')
or if you prefer a Cartesian plot
r = 1+cos(theta);
plot(r.*cos(theta), r.*sin(theta))
hold on
r = 3*cos(theta);
plot(r.*cos(theta), r.*sin(theta), 'r')
axis equal

Sk Rizwan Hossain
Sk Rizwan Hossain el 6 de Mayo de 2022
r=1+cos(theta)

Categorías

Más información sobre Polar Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by