Skip to content

〰️ Generate, animate your Hypotrochoid, Epitrochoid & Hypocycloid

License

Notifications You must be signed in to change notification settings

stabla/guillocheJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Guilloché Animator

Pre-notes: Feel free to contribute to the project.

https://stabla.github.io/guillocheJS/

Install it

Download the guilloche-animator.js and put it in your project's folder

<script src="guiloche-animator.js"></script>

Set the values you want in guilloche-animator.js in the figure: { ...

How it work

Guilloché Animator

Generating some spirography (Hypotrochoid, Epitrochoid or Hypocycloid) and make possible animation.

The first step is to create a HTML5 canvas. The second step is to draw the figure, but how exactly to draw the figure ? We have to know, what's a spirograph. At this time, the script only allow to make an Hypotrochoid, Epitrochoid or an Hypocycloid. So let's go to understand how draw a Hypotrochoid.

Hypotrochoid

hypotrochoid

So, this is, visually how it works. Now, lets do it by math.

Not reinvent the wheel. So open your favorite search-engine and check more about " hypotrochoid ", we immediatly falling on Wikipedia.

The radius of the biggest circle will be called major, R above in the equation.

The radius of the internal circle will be called minor, r above.

The point attached to the internal circle is to a distance d from the center of this same internal circle. Let's call it radius.

On wikipedia, we have our equation, so replace it with our notation :

hypotrochoid_equation_x

hypotrochoid_equation_y

In loop, we will draw it progressively, for each new incrementation, we change θ.

Set the value you want, and you can get something like that : hypotrochoid_preview

Epitrochoid

epitrochoid

Same for epitrochoid, we have this equation:

epitrochoid_equation_x

epitrochoid_equation_y

Set the value value you want, and you can get something like that : epitrochoid_preview

Hypocycloid -- not done.

About

〰️ Generate, animate your Hypotrochoid, Epitrochoid & Hypocycloid

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published