DEV Community

Peter Teoh
Peter Teoh

Posted on

Great fun playing with hypotrochoid

Introducing a simple formula for experimentation:

x = (R - r) * Math.cos(f1*t) * (1 + Math.cos(f2*t)) + d * Math.cos(((R - r) / r) * t);

y = (R - r) * Math.sin(f1*t) * (1 + Math.cos(f2*t)) - d * Math.sin(((R - r) / r) * t);

where R, r, d, f1, f2 are different tunable parameter. The path of (x,y) as t varies will generate the graphics as shown in the following writeup:

https://hackgptdeveloper.github.io/2024/12/01/hypotrochoid-v3-explore.html

For example:

Image description

Image description

Image description

Image description

Image description

Image description

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay