plotting cardioid and circle in one graph
이전 댓글 표시
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).
답변 (2개)
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
2022년 5월 6일
0 개 추천
r=1+cos(theta)
카테고리
도움말 센터 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!