A cardioid is a two-dimensional plane figure that has a heart-shaped curve described in polar coordinates by the equation r = 2a(1 + cos θ) for 0 ≤ θ ≤ 2π:

import numpy as np
import matplotlib.pyplot as plt
theta = np.linspace(0, 2.*np.pi, 1000)
a = 1.0
r = 2 * a * (1. + np.cos(theta))
plt.polar(theta , r)
plt.savefig("ex405.png", dpi=100)
plt.show()

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading