A
A
Andrey Bazykin2014-08-18 20:54:34
JavaScript
Andrey Bazykin, 2014-08-18 20:54:34

How to make a point move along an ellipse (tilted oval)?

Hello. Need help in writing the formula for moving a point along an ellipse (more like an oval in a slope). I managed to write the oval formula in a vertical position without problems, but in the slope there were difficulties.
To make it clearer jsfiddle.net/andreybazykin/4e404rbr You need to make the second point move along this trajectory, by analogy with the first one.
Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Petrov, 2014-08-18
@FAT

Example codepen.io/cleric/pen/mfyaE
The easiest way is to simply rotate the canvas itself. This is done for the second ellipse.
If the additional element is rotated, like the third ellipse, then you just need to apply the rotation matrix .
Which once again proves that linear algebra, mathematical analysis and other mathematics are not only the lot of game development.

M
Max, 2014-08-18
@AloneCoder

Something like this, the center needs to be shifted only
jsfiddle.net/4e404rbr/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question