plotting cardioid and circle in one graph

28 vues (au cours des 30 derniers jours)
amanina abdul rahman
amanina abdul rahman le 27 Nov 2015
Commenté : Raj le 20 Mar 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).

Réponses (2)

Thorsten
Thorsten le 27 Nov 2015
Modifié(e) : Thorsten le 27 Nov 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 le 6 Mai 2022
r=1+cos(theta)

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by