# elliptical orbit around two objects that move

0 favourites
• 4 posts
From the Asset Store
Move Block
\$10 USD
Captivating puzzle game. With challenging gameplay, this game will keep you very engaged.
• hello.

I'm trying to orbit sprite "c" around two other objects sprite "A" and "B". Both A and B will be moving slowly.

I'm lost on getting this to work. Help or links if this has already been answered are appreciated

<img src="http://dl.dropbox.com/u/3285817/orbitfoci.gif" border="0" />

• therefore u need that parametric view of your circle:

(r*cos(t)+x0,r*sin(t)+y0)

else you need the distance/2 between A and B, the "rotation point". at the start of ellipse events, there must be

xk=r*cos(t0)+x0

yk=r*sin(t0)+y0

if this is correct u need

tan(startAngle)=sin(t0)/cos(t0)

for the following frames.

when u got this, the new point of C is

for instance:

t0=10?=Pi/18

t1=120?=2/3*Pi

(1,2)=(2*cos(t0)+x0; 2*sin(t0)+y0)

x0=1-2*cos(Pi/18 )=-0,969615506

y0=2-2*sin(Pi/18 )=1,652703645

target point:

xk=-1,969615506

yk=3,384754453

• thank you very much. I will try this out.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• ouch...that hurt my head. <img src="smileys/smiley5.gif" border="0" align="middle" />

• 4 posts