Objective
The objective of this post is to systematically derive the corresponding parametric equations and implement them in Python for visualization using Manim. The aim is not only to develop a clear analytical understanding of these curves, but also to bring them to life through computational animation.
Definition
Cycloidal curves are the loci of a fixed point on the circumference of a circle as it rolls without slipping along a given path. Depending on whether the circle rolls along a straight line, on the outside of another circle, or on the inside of another circle, the resulting curve is classified as a cycloid, an epicycloid, or a hypocycloid.

Cardioid ($r = R$), a special case of the epicycloid.
Cycloid
$x(\theta) = r(\theta - \sin \theta)$
$y(\theta) = r(1 - \cos \theta)$
A cycloid is the curve traced by a point on the circumference of a circle as it rolls along a straight line (the directrix) without slipping.
In engineering, the cycloid is notable for its brachistochrone property—representing the path of fastest descent under gravity—and its tautochrone property, where the time taken by a particle to reach the lowest point is independent of its starting position.
Derivation of Parametric Equations of Cycloid

$s = r\theta$
$a = r \cos \theta$
$b = r \sin \theta$
$x = s - b = r\theta - r \sin \theta$
$x = r(\theta - \sin \theta)$
$y = r - a = r - r \cos \theta)$
$y = r(1 - \cos \theta)$
Area and Length of Arc of a Cycloid
The length of arc and area of a cycloid, by integration, is posted at node 2353.
Manim Code for Cycloid
The scripts provided below were developed with AI assistance and were carefully reviewed to ensure alignment with the mathematical principles discussed.
Click here to expand or collapse this section
from manim import *
import numpy as np
class Cycloid(Scene):
def construct(self):
# Parameters
r = 1.5
# Ground shifted downward by 0.5 * r
ground_y = -0.5 * r
# Center y-level so circle touches the ground: ground_y + r
center_y_level = ground_y + r
# Horizontal shift to center the cycloid peak at x=0
shift_x = -PI * r
start_theta = -60 * DEGREES
end_theta = TAU + 60 * DEGREES
# 1. Directrix (Ground) - Red
# Note: Ground is placed at ground_y
ground = Line(
start=[-6.75, ground_y, 0],
end=[6.75, ground_y, 0],
color=RED,
stroke_width=2
)
# 2. ValueTracker for the rolling angle theta
t_tracker = ValueTracker(start_theta)
# 3. The Rolling Group (Circle + Rotating Radius + Tracing Point)
def get_rolling_group():
theta = t_tracker.get_value()
# Center moves linearly: x = r * theta + shift, y = center_y_level
center_pos = np.array([r * theta + shift_x, center_y_level, 0])
# The Tracing Point (Yellow)
# Calculated relative to center
dot_pos = center_pos + np.array([
-r * np.sin(theta),
-r * np.cos(theta),
0
])
circle = Circle(radius=r, color=BLUE, stroke_width=4).move_to(center_pos)
radius_line = Line(center_pos, dot_pos, color=BLUE, stroke_width=4)
dot = Dot(dot_pos, color=YELLOW, radius=0.08).set_z_index(10)
return VGroup(circle, radius_line, dot)
rolling_circle_group = always_redraw(get_rolling_group)
# 4. The Cycloid Trace (Yellow)
# y-coordinate is (r * (1 - cos(t))) + ground_y
cycloid_path = always_redraw(lambda: ParametricFunction(
lambda t: np.array([
r * (t - np.sin(t)) + shift_x,
r * (1 - np.cos(t)) + ground_y,
0
]),
t_range=[start_theta, max(start_theta + 0.001, t_tracker.get_value())],
color=YELLOW,
stroke_width=6
))
title = Tex(r"\textbf{Cycloid}", font_size=52).next_to(ground, DOWN, buff=0.5)
# --- Animation Sequence ---
self.play(Write(title))
self.play(Create(ground))
self.play(Create(cycloid_path), Create(rolling_circle_group))
self.play(
t_tracker.animate.set_value(end_theta),
run_time=12, # Slightly slower for the larger scale
rate_func=linear
)
self.wait(3)
Video Output of Manim Code for Cycloid
Note: The visual branding shown in the videos (e.g. MATHalino logo) is not included in the shared Manim code to keep the scripts clean and reusable.
Epicycloid
$x(\theta) = (R + r) \cos \theta - r \cos \left( \dfrac{R + r}{r} \theta \right)$
$y(\theta) = (R + r) \sin \theta - r \sin \left( \dfrac{R + r}{r} \theta \right)$
An epicycloid is a plane curve generated by a point on the circumference of a circle (the generating circle) that rolls along the exterior of a fixed circle (the base circle). The shape of the resulting path is determined by the ratio of the radii of the two circles. A common application of the epicycloid is in the profile of planetary gears and certain types of rotary pumps.
Derivation of Parametric Equations of Epicycloid

$s_2 = s_1$
$r \alpha = R \theta$
$\alpha = \dfrac{R \theta}{r}$
$x_1 = (R + r) \cos \theta$
$\begin{align}x_2 & = r \cos (\alpha + \theta) = r \cos \left(\dfrac{R \theta}{r} + \theta \right) \\
& = r \cos \left(\dfrac{R + r}{r} \theta \right)\end{align}$
$x = x_1 - x_2$
$x = (R + r) \cos \theta - r \cos \left(\dfrac{R + r}{r} \theta \right)$
$y_1 = (R + r) \sin \theta$
$\begin{align}y_2 & = r \sin (\alpha + \theta) = r \sin \left(\dfrac{R \theta}{r} + \theta \right) \\
& = r \sin \left(\dfrac{R + r}{r} \theta \right)\end{align}$
$y = y_1 - y_2$
$y = (R + r) \sin \theta - r \sin \left(\dfrac{R + r}{r} \theta \right)$
Distance from the Origin to a Point on the Epicycloid
${R_C}^2 = x^2 + y^2$
From the parametric equations:
$x = (R + r) \cos \theta - r \cos \left(\dfrac{R + r}{r} \theta \right)$
$y = (R + r) \sin \theta - r \sin \left(\dfrac{R + r}{r} \theta \right)$
$a = R + r$ and $b = \dfrac{R + r}{r}$
The parametric equations will become
$x = a \cos \theta - r \cos b\theta$
$y = a \sin \theta - r \sin b\theta$
$x^2 = (a \cos \theta - r \cos b\theta)^2$
$x^2 = a^2 \cos^2 \theta - 2ar \cos \theta \cos b\theta + r^2 \cos^2 b\theta$
$y^2 = (a \sin \theta - r \sin b\theta)^2$
$y^2 = a^2 \sin^2 \theta - 2ar \sin \theta \sin b\theta + r^2 \sin^2 b\theta$
${R_C}^2 = (a^2 \cos^2 \theta - 2ar \cos \theta \cos b\theta + r^2 \cos^2 b\theta) + (a^2 \sin^2 \theta - 2ar \sin \theta \sin b\theta + r^2 \sin^2 b\theta)$
${R_C}^2 = a^2 (\sin^2 \theta + \cos^2 \theta) + r^2 (\sin^2 b\theta + \cos^2 b\theta) - 2ar (\cos \theta b\cos \theta + \sin \theta \sin b\theta)$
${R_C}^2 = a^2 (1) + r^2 (1) - 2ar (\cos b\theta \cos \theta + \sin b\theta \sin \theta)$
$\cos A \cos B + \sin A \sin B = \cos (A - B)$
For $A = b\theta$ and $B = \theta$:
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos (b - 1)\theta$
$k = \dfrac{R + r}{r} - 1 = \dfrac{R + r - r}{r} = \dfrac{R}{r}$
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos k\theta$
Hence,
${R_C}^2 = a^2 + r^2 - 2ar \cos k\theta$
$R_C = \sqrt{a^2 + r^2 - 2ar \cos k\theta}$
Limits of Integration (Epicycloid and Hypocycloid)
The calculations below have been verified by MATHalino for $r \le R$. No verification has yet been carried out by MATHalino for the case $r \gt R$.
Central Angle for One Rotation
When the circle of radius $r$ completes one full rotation while rolling on the circle of radius $R$, it travels a distance of $2\pi r$. This arc length on the fixed circle subtends an angle $\alpha$ at its center, so
$$R\alpha = 2\pi r$$
from which
$$\alpha = \dfrac{2\pi r}{R} = \dfrac{2\pi}{R/r} = \dfrac{2\pi}{k}$$
Therefore, for one complete rotation of the rolling circle, the limit of integration is from $0$ to $2\pi /k$.
Number of Cusps (Epicycloid and Hypocycloid)
The number of cusps depends on the ratio $R/r$. Writing $R = nr$, the number of cusps is equal to $n$ when $n$ is an integer.

For non-integer $n$, write the ratio in lowest terms as $p/q$. The number of cusps is then $p$, while the number of revolutions required for the graph to close is $q$. If $R/r$ is irrational, the number of cusps is infinite because the graph never closes.
Area of Epicycloid
The area of an epicycloid is the region between the epicycloidal curve and the fixed circle. In other words, it is the area inside the epicycloid but outside the fixed circle.
For cases with no overlapping cusps, the total area of the epicycloid is equal to $n$ times the area of one cusp.

Differential Area of Epicycloid
$dA = \frac{1}{2}({R_C}^2 - R^2) \, d\theta$
$dA = \frac{1}{2} \left[ (a^2 + r^2 - 2ar \cos k\theta) - R^2 \right] \, d\theta$
$dA = \frac{1}{2} \left[ (a^2 + r^2 - R^2) - 2ar \cos k\theta \right] \, d\theta$
$dA = \left( \dfrac{a^2 + r^2 - R^2}{2} - ar \cos k\theta \right) \, d\theta$
Area of One Cusp of Epicycloid
The area between the fixed circle and the epicycloid arc is the shaded region in the figure above. This region is outside the fixed circle but inside the epicycloid.
$A = \displaystyle \dfrac{a^2 + r^2 - R^2}{2} \int_0^{2\pi / k} d\theta - ar \int_0^{2\pi / k} \cos k\theta \, d\theta$
$A = \displaystyle \dfrac{a^2 + r^2 - R^2}{2} \left[ \theta \right]_0^{2\pi / k} - \dfrac{ar}{k}\left[ \sin k\theta \right]_0^{2\pi / k}$
$A = \displaystyle \dfrac{a^2 + r^2 - R^2}{2} \left[ \dfrac{2\pi}{k} - 0 \right] - \dfrac{ar}{k}\left[ \sin \left( k \cdot \dfrac{2\pi}{k} \right) - \sin 0 \right]$
$A = \displaystyle \dfrac{a^2 + r^2 - R^2}{2} \left[ \dfrac{2\pi}{R/r}\right] - \dfrac{ar}{R/r}\left[ \sin (2\pi) \right]$
$A = (a^2 + r^2 - R^2) \cdot \dfrac{\pi r}{R}$
$A = \left[ (R + r)^2 + r^2 - R^2 \right] \cdot \dfrac{\pi r}{R}$
$A = \left[ (R^2 + 2Rr + r^2) + r^2 - R^2 \right] \cdot \dfrac{\pi r}{R}$
$A = (2Rr + 2r^2) \cdot \dfrac{\pi r}{R}$
$A = 2r(R + r) \cdot \dfrac{\pi r}{R}$
For $R = 3$ and $r = 1$:
$A = 2 \left( \dfrac{3 + 1}{3} \right) \pi (1^2)$
$A = \dfrac{8\pi}{3} \text{unit}^2$
Differential Length of Arc of Epicycloid
$dL = \sqrt{\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2} \, d\theta$
$x = a \cos \theta - r \cos b\theta$
$\dfrac{dx}{d\theta} = -a \sin \theta + br \sin b\theta = -a\left( \sin \theta - \dfrac{br}{a} \sin b\theta \right)$
$\dfrac{dx}{d\theta} = -a (\sin \theta - \sin b\theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 = a^2 (\sin \theta - \sin b\theta)^2 = a^2 (\sin^2 \theta - 2\sin \theta \sin b\theta + \sin^2 b\theta)$
$y = a \sin \theta - r \sin b\theta$
$\dfrac{dy}{d\theta} = a \cos \theta - br \cos b\theta = a\left( \cos \theta - \dfrac{br}{a} \cos b\theta \right)$
$\dfrac{dy}{d\theta} = a(\cos \theta - \cos b\theta)$
$\left( \dfrac{dy}{d\theta} \right)^2 = a^2 (\cos \theta - \cos b\theta)^2 = a^2 (\cos^2 \theta - 2\cos \theta \cos b\theta + \cos^2 b\theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = a^2 (\sin^2 \theta + \cos^2 \theta) + a^2 (\sin^2 b\theta + \cos^2 b\theta) - 2a^2 (\sin \theta \sin b\theta + \cos \theta \cos b\theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = a^2 (1) + a^2 (1) - 2a^2 (\cos b\theta \cos \theta + \sin b\theta \sin \theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = 2a^2 - 2a^2 (\cos b\theta \cos \theta + \sin b\theta \sin \theta)$
$\cos (A - B) = \cos A \cos B + \sin A \sin B$
For $A = b\theta$ and $B = \theta$:
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos (b\theta - \theta)$
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos (b - 1)\theta$
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos k\theta$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = 2a^2 - 2a^2 \cos k\theta = 2a^2 (1 - \cos k\theta)$
$1 - \cos \alpha = 2\sin^2 (\alpha/2)$
For $\alpha = k\theta$:
$1 - \cos k\theta = 2\sin^2 (k\theta/2)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = 2a^2 \cdot 2\sin^2 \left( \dfrac{k\theta}{2} \right) = 4a^2 \sin^2 \left( \dfrac{k\theta}{2} \right)$
Hence;
$dL = \sqrt{4a^2 \sin^2 \left( \dfrac{k\theta}{2} \right)} \, d\theta$
$dL = 2a \sin \left( \dfrac{k\theta}{2} \right) \, d\theta$
Length of One Arc of Epicycloid
$L = 2a \displaystyle \int_0^{2\pi/k} \sin \left( \dfrac{k\theta}{2} \right) \, d\theta$
$L = 2a \cdot \dfrac{2}{k} \displaystyle \int_0^{2\pi/k} \sin \left( \dfrac{k\theta}{2} \right) \, \left( \dfrac{k}{2} d\theta \right)$
$L = \dfrac{4a}{k} \left[ -\cos \left( \dfrac{k\theta}{2} \right) \right]_0^{2\pi/k}$
$L = \dfrac{4a}{k} \left[ -\cos \pi + \cos 0 \right] = \dfrac{4a}{k} \left[ -(-1) + 1 \right]$
$L = \dfrac{8a}{k} = 8a \cdot \dfrac{1}{k} = 8(R + r) \cdot \dfrac{r}{R}$
For $R = 3$ and $r = 1$:
$L = \dfrac{8(1)(3 + 1)}{3} = \dfrac{32}{3} \, \text{units}$
Manim Code for Epicycloid of Three Cusps
The code below was created with the assistance of AI technology, and the mathematics was thoroughly verified by me. Here, $n = 3$ is used to produce 3 cusps.
Click here to expand or collapse this section
from manim import *
import numpy as np
class Epicycloid(Scene):
def construct(self):
# --- Parameters ---
R = 1.75
r = R / 3
# --- Title ---
title = Tex(r"\textbf{Epicycloid}", font_size=52).to_edge(UP)
self.play(Write(title))
# --- Tracker ---
t = ValueTracker(0.0)
# --- Fixed circle (RED) ---
fixed_circle = Circle(radius=R, color=RED, stroke_width=4)
# --- Rolling center position ---
def rolling_center_point():
ang = t.get_value()
return np.array([(R + r) * np.cos(ang), (R + r) * np.sin(ang), 0.0])
# --- Epicycloid tracing point position ---
def epicycloid_point():
ang = t.get_value()
k = (R + r) / r
return np.array([
(R + r) * np.cos(ang) - r * np.cos(k * ang),
(R + r) * np.sin(ang) - r * np.sin(k * ang),
0.0
])
# --- Rolling circle (BLUE) ---
rolling_circle = Circle(radius=r, color=BLUE, stroke_width=3)
# Move + roll (rotate) updater
def roll_updater(mob):
mob.move_to(rolling_center_point())
# desired physical rotation angle about its center
# theta = -((R+r)/r) * t
target = -((R + r) / r) * t.get_value()
# set absolute angle (not incremental): rotate by (target - current_angle)
mob.rotate(target - mob.get_angle(), about_point=mob.get_center())
rolling_circle.add_updater(roll_updater)
# --- Tracing dot (YELLOW) ---
gen_dot = always_redraw(lambda: Dot(epicycloid_point(), color=YELLOW, radius=0.06))
# --- Radius line inside rolling circle: center -> tracing point ---
radius_line = always_redraw(
lambda: Line(
rolling_center_point(),
epicycloid_point(),
color=BLUE,
stroke_width=4
)
)
# --- Trace (YELLOW epicycloid) ---
trace = TracedPath(
gen_dot.get_center,
stroke_color=YELLOW,
stroke_width=5,
dissipating_time=0.0
)
label = Tex(r"$r=\frac{R}{3}$", font_size=38).to_edge(DOWN)
# --- Add objects ---
self.play(Create(fixed_circle), Create(rolling_circle), Create(radius_line), Create(trace), Create(gen_dot))
self.play(Write(label))
# --- Animate (closes at 2π) ---
self.play(t.animate.set_value(2 * PI), run_time=10, rate_func=linear)
self.wait(2)
Video Output of Manim Code for Epicycloid
Hypocycloid
$x(\theta) = (R - r) \cos \theta + r \cos \left( \dfrac{R - r}{r} \theta \right)$
$y(\theta) = (R - r) \sin \theta - r \sin \left( \dfrac{R - r}{r} \theta \right)$
A hypocycloid is the path traced by a point on the circumference of a circle as it rolls along the interior of a larger fixed circle. If the radius of the rolling circle is exactly one-fourth that of the fixed circle, the resulting four-cusped curve is known as an astroid. These curves are frequently analyzed in kinematics to describe the relative motion of machine parts within a circular housing.
Derivation of Parametric Equations of Hypocycloid

$s_2 = s_1$
$r(\alpha + \theta) = R \theta$
$\alpha = \dfrac{R \theta}{r} - \theta$
$\alpha = \dfrac{R - r}{r}\theta$
$x_1 = (R - r) \cos \theta$
$x_2 = r \cos \alpha = r \cos \left( \dfrac{R - r}{r}\theta \right)$
$x = x_1 + x_2$
$x = (R - r) \cos \theta + r \cos \left( \dfrac{R - r}{r}\theta \right)$
$y_1 = (R - r) \sin \theta$
$y_2 = r \sin \alpha = r \sin \left( \dfrac{R - r}{r}\theta \right)$
$y = y_1 - y_2$
$y = (R - r) \sin \theta - r \sin \left( \dfrac{R - r}{r}\theta \right)$
Distance from the Origin to a Point on the Hypocycloid
${R_C}^2 = x^2 + y^2$
From the parametric equations:
$x = (R - r) \cos \theta + r \cos \left(\dfrac{R - r}{r} \theta \right)$
$y = (R - r) \sin \theta - r \sin \left(\dfrac{R - r}{r} \theta \right)$
$a = R - r$ and $b = \dfrac{R - r}{r}$
The parametric equations will become
$x = a \cos \theta + r \cos b\theta$
$y = a \sin \theta - r \sin b\theta$
$x^2 = (a \cos \theta + r \cos b\theta)^2$
$x^2 = a^2 \cos^2 \theta + 2ar \cos \theta \cos b\theta + r^2 \cos^2 b\theta$
$y^2 = (a \sin \theta - r \sin b\theta)^2$
$y^2 = a^2 \sin^2 \theta - 2ar \sin \theta \sin b\theta + r^2 \sin^2 b\theta$
${R_C}^2 = a^2 (\sin^2 \theta + \cos^2 \theta) + r^2 (\sin^2 b\theta + \cos^2 b\theta) + 2ar (\cos \theta \cos b\theta - \sin \theta \sin b\theta)$
${R_C}^2 = a^2 (1) + r^2 (1) + 2ar (\cos b\theta \cos \theta - \sin b\theta \sin \theta)$
$\cos A \cos B - \sin A \sin B = \cos (A + B)$
For $A = b\theta$ and $B = \theta$:
$\cos b\theta \cos \theta - \sin b\theta \sin \theta = \cos (b + 1)\theta$
$k = \dfrac{R - r}{r} + 1 = \dfrac{R - r + r}{r} = \dfrac{R}{r}$
$\cos b\theta \cos \theta - \sin b\theta \sin \theta = \cos k\theta$
Hence,
${R_C}^2 = a^2 + r^2 + 2ar \cos k\theta$
$R_C = \sqrt{a^2 + r^2 + 2ar \cos k\theta}$

Differential Area of Hypocycloid
$dA = \frac{1}{2}(R^2 - {R_C}^2) \, d\theta$
$dA = \frac{1}{2} \left[ R^2 - (a^2 + r^2 + 2ar \cos k\theta) \right] \, d\theta$
$dA = \frac{1}{2} \left[ (R^2 - a^2 - r^2) - 2ar \cos k\theta \right] \, d\theta$
$dA = \left( \dfrac{R^2 - a^2 - r^2}{2} - ar \cos k\theta \right) \, d\theta$
Area of One Cusp of Hypocycloid
$A = \dfrac{R^2 - a^2 - r^2}{2} \displaystyle \int_0^{2\pi/k} d\theta - ar \int_0^{2\pi/k} \cos k\theta \, d\theta$
$A = \dfrac{R^2 - a^2 - r^2}{2} \left[ \theta \right]_0^{2\pi/k} - \dfrac{ar}{k} \left[ \sin k\theta \right]_0^{2\pi/k}$
$A = \dfrac{R^2 - a^2 - r^2}{2} \left[ \dfrac{2\pi}{k} - 0 \right] - \dfrac{ar}{k} \left[ \sin \left( k \cdot \dfrac{2\pi}{k} \right) - \sin 0 \right]$
$A = \dfrac{R^2 - a^2 - r^2}{2} \left[ \dfrac{2\pi}{R/r} \right] - \dfrac{ar}{R/r} \left[ \sin (2\pi) \right]$
$A = \left[ R^2 - (R - r)^2 - r^2 \right] \cdot \dfrac{\pi r}{R}$
$A = (2Rr - 2r^2) \cdot \dfrac{\pi r}{R}$
$A = 2r(R - r) \cdot \dfrac{\pi r}{R}$
For $R = 4$ and $r = 1$:
$A = 2\left( \dfrac{4 - 1}{4} \right) \pi (1^2)$
$A = \dfrac{3\pi}{2} \text{unit}^2$

Differential Length of Arc of Hypocycloid
$dL = \sqrt{\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2} \, d\theta$
$x = a \cos \theta + r \cos b\theta$
$\dfrac{dx}{d\theta} = -a \sin \theta - br \sin b\theta = -a\left( \sin \theta + \dfrac{br}{a} \sin b\theta \right)$
$\dfrac{dx}{d\theta} = -a (\sin \theta + \sin b\theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 = a^2 (\sin \theta - \sin b\theta)^2 = a^2 (\sin^2 \theta + 2\sin \theta \sin b\theta + \sin^2 b\theta)$
$y = a \sin \theta - r \sin b\theta$
$\dfrac{dy}{d\theta} = a \cos \theta - br \cos b\theta = a\left( \cos \theta - \dfrac{br}{a} \cos b\theta \right)$
$\dfrac{dy}{d\theta} = a(\cos \theta - \cos b\theta)$
$\left( \dfrac{dy}{d\theta} \right)^2 = a^2 (\cos \theta - \cos b\theta)^2 = a^2 (\cos^2 \theta - 2\cos \theta \cos b\theta + \cos^2 b\theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = a^2 (\sin^2 \theta + \cos^2 \theta) + a^2 (\sin^2 b\theta + \cos^2 b\theta) - 2a^2 (\sin \theta \sin b\theta - \cos \theta \cos b\theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = a^2 (1) + a^2 (1) - 2a^2 (\cos b\theta \cos \theta - \sin b\theta \sin \theta)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = 2a^2 - 2a^2 (\cos b\theta \cos \theta - \sin b\theta \sin \theta)$
$\cos (A + B) = \cos A \cos B - \sin A \sin B$
For $A = b\theta$ and $B = \theta$:
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos (b\theta + \theta)$
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos (b + 1)\theta$
$\cos b\theta \cos \theta + \sin b\theta \sin \theta = \cos k\theta$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = 2a^2 - 2a^2 \cos k\theta = 2a^2 (1 - \cos k\theta)$
$1 - \cos \alpha = 2\sin^2 (\alpha/2)$
For $\alpha = k\theta$:
$1 - \cos k\theta = 2\sin^2 (k\theta/2)$
$\left( \dfrac{dx}{d\theta} \right)^2 + \left( \dfrac{dy}{d\theta} \right)^2 = 2a^2 \cdot 2\sin^2 \left( \dfrac{k\theta}{2} \right) = 4a^2 \sin^2 \left( \dfrac{k\theta}{2} \right)$
Hence;
$dL = \sqrt{4a^2 \sin^2 \left( \dfrac{k\theta}{2} \right)} \, d\theta$
$dL = 2a \sin \left( \dfrac{k\theta}{2} \right) \, d\theta$
Length of One Arc of Hypocycloid
$L = 2a \displaystyle \int_0^{2\pi/k} \sin \left( \dfrac{k\theta}{2} \right) \, d\theta$
$L = 2a \cdot \dfrac{2}{k} \displaystyle \int_0^{2\pi/k} \sin \left( \dfrac{k\theta}{2} \right) \, \left( \dfrac{k}{2} d\theta \right)$
$L = \displaystyle \dfrac{4a}{k} \left[ -\cos \left( \dfrac{k\theta}{2} \right) \right]_0^{2\pi/k}$
$L = \dfrac{4a}{k} \left[ -\cos \pi + \cos 0 \right] = \dfrac{4a}{k} \left[ -(-1) + 1 \right]$
$L = \dfrac{8a}{k} = 8a \cdot \dfrac{1}{k} = 8(R - r) \cdot \dfrac{r}{R}$
For $R = 4$ and $r = 1$:
$L = \dfrac{8(1)(4 - 1)}{4} = 6 \, \text{units}$
Manim Code for Hypocycloid of Four Cusps (Astroid)
We used AI for the Manim code while ensuring that the mathematics is fully consistent with the calculations above. In this code, we created an astroid, which is a hypocycloid with four cusps.
Click here to expand or collapse this section
from manim import *
import numpy as np
class Hypocycloid(Scene):
def construct(self):
# --- Geometry parameters ---
R = 3.5
r = R / 4
# Colors (as requested)
FIXED_COLOR = RED
ROLLING_COLOR = BLUE
TRACE_COLOR = YELLOW
# --- Trackers ---
t = ValueTracker(0.0)
# --- Helper functions ---
def rolling_center():
ang = t.get_value()
return (R - r) * np.array([np.cos(ang), np.sin(ang), 0.0])
def tracing_point():
ang = t.get_value()
k = (R - r) / r # for R=3.5, r=0.875 => k=3
return np.array([
(R - r) * np.cos(ang) + r * np.cos(k * ang),
(R - r) * np.sin(ang) - r * np.sin(k * ang),
0.0
])
# --- Fixed circle (RED) ---
fixed_circle = Circle(radius=R, color=FIXED_COLOR).move_to(ORIGIN)
# --- Rolling circle (BLUE), updated as it rolls ---
rolling_circle = Circle(radius=r, color=ROLLING_COLOR)
rolling_circle.add_updater(lambda m: m.move_to(rolling_center()))
# No-slip rotation of rolling circle about its own center
# (set absolute angle each frame to avoid drift)
def roll_spin_updater(mob):
ang = t.get_value()
target = -((R - r) / r) * ang
mob.rotate(target - mob.get_angle(), about_point=mob.get_center())
rolling_circle.add_updater(roll_spin_updater)
# --- Radius of rolling circle (BLUE) ---
radius_line = always_redraw(
lambda: Line(
rolling_center(),
tracing_point(),
color=ROLLING_COLOR
)
)
# --- Tracing dot (YELLOW) ---
dot = always_redraw(lambda: Dot(tracing_point(), radius=0.06, color=TRACE_COLOR))
# --- Hypocycloid path (YELLOW) ---
path = TracedPath(dot.get_center, stroke_color=TRACE_COLOR, stroke_width=6)
# --- Animate ---
self.play(Create(fixed_circle), Create(rolling_circle))
self.add(path, radius_line, dot)
# One closed curve for r = R/4 (k = 3) completes at 2π
self.play(t.animate.set_value(TAU), run_time=8, rate_func=linear)
# Keep everything on screen at the end
self.wait(1)
Video Output of Manim Code for Hypocycloid