type
status
date
slug
summary
tags
category
icon
password
Approximate and animate extracted contours from a given png using DFT. Inspired by 3b1b.
Introduction
Epicycles
In general, epicycles are curves defined by the equations:
therefore
e.g.
The parametric path for the curve can be denoted as:
DFT
The Discrete Fourier Transform (DFT) is defined as
where
Its inverse transform (IDFT) is given by:
where
Trigonometric interpolation
Consider a set of points belonging to the parametric curve
The goal of trigonometric interpolation is to find a trigonometric polynomial that passes through these points.
A trigonometric polynomial of degree (where typically for an odd number of points, or for an even number of points) is given by:
To find the coefficients , note that the coefficients can be obtained directly from the DFT coefficients by the relation .
Interpolation Process
- Compute DFT: Apply DFT to the given data points to obtain the coefficients .
- Construct Trigonometric Polynomial: Use the coefficients to construct the trigonometric polynomial .
- Interpolation: To interpolate or estimate the value at any point , plug the value of into the polynomial . This gives you the interpolated value at that point.
Visualization with Manim
Manim was created by Grant Sanderson, better known as the person behind the YouTube channel "3Blue1Brown". It was developed to produce the distinctive and visually appealing animations seen in his videos, which explain a wide range of mathematical concepts.
ManimCE is a fork of the original Manim project. It's community-driven and open-source, with contributions from a broader community of developers.
TBC…
Reference
[1] Ponce Campuzano, Juan. (2022). Trigonometric interpolation using the Discrete Fourier Transform. 10. 1-13.
[2] Ponce Campuzano, Juan. (2023). Tracing closed curves with epicycles: A fun application of the Discrete Fourier Transform. 11. 1-16.
- Author:VernonWu
- URL:https://vernonwu.com/article/epicycles
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts