# Orbital Movements (Updated)

Hello,

I saw this animation online and wanted to try and replicate the movement in GH - (at least get close).
It appears a point emitter is used but then the circles transitions to orbital movements.

I have attempted it (attached below) but could do with some help on:

1. Randomness of the orbits size
2. Randomness of the plane orientation
3. Points moving along the orbital path, preferably at different speeds; but I think the size of the orbital path will dictate speed.
3a. Is it possible to have the point emit and transition to an orbital trajectory?

Any help in improving this would be greatly appreciated and I look forward to studying the solutions.

many thanks.

orbits.gh (19.0 KB)

Interesting!

So, thinking of a virtual sun-like â€ścentral massâ€ť, the initial idea is to build up ellipses (orbits) already in the correct place!
Instead of creating random ellipses and then aligning it to the sun (a mess), with the focus-focus-point method we are sure the orbit to be exact!
Rhinoâ€™s â€śEllipse: from fociâ€ť is missing on grasshopper, so i made it with c#, it retrieve also Plane, R1, R2 and e (eccentricity).

orbits_re.gh (123.2 KB)

Correct! Keplerâ€™s laws help us there.

Then, the â€śusual problemâ€ť (saying so after 15 min research on the www) is foreseeing correctly the position of an elliptically orbiting object given a starting position and a time interval.
It would require complex math (for me) and maybe heavy calculations that would slow down the animation. Maybe iâ€™m totally wrong here.

So, iâ€™ve mapped every possible ellipse in a 3d surface, internalized it weight about 100kB (inside the method used to build that up, disabled).
Making a fast intersection on a 3d-data is surely fast enough to let us appreciate a realtime smooth animation.

Long story short:

And this is what is happening behind the scenes:

6 Likes

Wow! This is fantastic, thank you Riccardo.

This is great. I like how it is in constant motion, but how would you go about animating a slider to export as a short movie clip?

Instead of the â€śTimer + counterâ€ť block , use a simple slider, set proper values (let it have enough decimals), and right-click > animate.

1 Like

Thank you! There is a lot to learn from this definition, and I am grateful for your time.

Hello @FordEarl,

You can also simulate this Kangaroo. Iâ€™m actually struggling to recreate this using K2 for some reason - Iâ€™ve never modelled particle systems using K2 before, but Kangaroo1 still works fine and quicker than writing my own code! Essentially itâ€™s just an inverse square law attraction with an initial velocity.

particles3D.gh (19.3 KB)

Obviously a different way of going about things, not sure if itâ€™s any better but fun to try.

John.

5 Likes

Very nice! Thank you for sharing this John, this is another definition with a lot to learn from. Very much appreciated.

Thanks John.
Youâ€™re right that this is one thing that is still easier with the old solver. I wrote a bit about this here:

Also - I made a small modification to your definition - the exponent for the attraction needs to be negative 2. With this changed it gives closed elliptical orbits:
particles3D_2.gh (17.3 KB)

10 Likes

oops, good spot Daniel thanks!

Indeed, simulating dynamics in Grasshopper seems a bit too niche compared the many advantages of finding fast ways to minimise energy!

In a strange twisted way, I do miss the blow ups though - it reminded me that the universe has a very small timestepâ€¦ maybe even Planck time

@FordEarl you should consider changing the solution to the kangarooâ€™s one. Itâ€™s definitively simpler.
I made my solution thinking it was strictly needed to work with elliptical curves as input, though you never actually said it. Sometime i have subconscious â€śhorse blindersâ€ťâ€¦

I like them both different approaches to solving the problem provide opportunities for deeper learning and understanding.

1 Like