File Exchange

image thumbnail

Drawing with Fourier Epicycles

version 1.1.0 (40 KB) by Víctor Martínez-Cagigal
GUI that computes the required epicycles to match a custom drawing by using DFTs


Updated 05 Oct 2020

From GitHub

View Version History

View license on GitHub

An epicycle is an orbit revolving around a point on the deferent. This GUI computes the required epicycles (i.e., radii, frequency and phase of all of them) in order to match a previously drawn curve, depicting an animation to see the result. The function also allows for uploading the XY coordinates of a custom curve, if needed.

Example of use:

The main function is 'fourier_epicycles(curve_x, curve_y, no_circles)', the rest of them are required to plot the GUI. Thus, this function can be used separately. Basically, the function converts XY coordinates in a complex vector Z = X + iY. Afterwards, it computes the Discrete Fourier Transform of Z, which is used to derive the radii (abs(Z)), frequency (index) and initial phase (angle(Z)) of each circle.

Input parameters:
- curve_x: X coordinates of the curve.
- curve_y: Y coordinates of the curve.
- no_circles: (Optional) Maximum number of circles. The maximum drawing accuracy is reached if the no_circles is exactly the number of points of the curve.

Example of use:
load('heart.mat'); fourier_epicycles(curve_x, curve_y);

Cite As

Víctor Martínez-Cagigal (2021). Drawing with Fourier Epicycles (, GitHub. Retrieved .

Comments and Ratings (9)

Alexandros Tsoupis

Kenneth Charles

Very nice idea, but I keep getting the error "Error in fourier_epicycles (line 31)
if nargin < 3, no_circles = length(curve_x); end" while trying to run your heart example.

Maximilian Heindel


Ashique Jabir

How to use this...? I am getting this error "Unrecognized function or variable 'curve_x'."

Nikita Solovyanchik

How to use it? , please send

Ammar Ahmad

Erez Wolfson

Very nice job!


MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!