## Discuss Scratch

### Creating Elliptical Orbits

Sorry if this doesn't belong in the AT forums, I just think it sounds advanced
I would like to know how to do an elliptical orbit for a circular object orbiting around another object.

Last edited by CatsUnited (April 8, 2015 05:33:17)

bottom text

### Creating Elliptical Orbits

If the ellipse can be stretched only on the x or y axis, try:
`forever    set [i v] to     repeat (360)        go to x:((center-x) + ((x-radius) * ([cos v] of (i)))) y:((center-y) + ((y-radius) * ([sin v] of (i))))        change [i v] by (1)    endend`

If you need something more complicated than that, you could try looking up “parametric equation of an ellipse,” although I'm sure I've seen some orbit projects around here and you could probably steal the code from there.

### Creating Elliptical Orbits

NickyNouse wrote:

If the ellipse can be stretched only on the x or y axis, try:
`forever    set [i v] to     repeat (360)        go to x:((center-x) + ((x-radius) * ([cos v] of (i)))) y:((center-y) + ((y-radius) * ([sin v] of (i))))        change [i v] by (1)    endend`

If you need something more complicated than that, you could try looking up “parametric equation of an ellipse,” although I'm sure I've seen some orbit projects around here and you could probably steal the code from there.
Okay, I'll test it out soon.

bottom text

### Creating Elliptical Orbits

NickyNouse wrote:

If you need something more complicated than that, you could try looking up “parametric equation of an ellipse,” although I'm sure I've seen some orbit projects around here and you could probably steal the code from there.

Like so: https://scratch.mit.edu/projects/56127958/

(Literally a 2 minute hack to remix)

### Creating Elliptical Orbits

gtoal wrote:

NickyNouse wrote:

If you need something more complicated than that, you could try looking up “parametric equation of an ellipse,” although I'm sure I've seen some orbit projects around here and you could probably steal the code from there.

Like so: https://scratch.mit.edu/projects/56127958/

(Literally a 2 minute hack to remix)
I won't be on the computer again for about 14 hours.

bottom text

### Creating Elliptical Orbits

Here's one that lets you change the orbit parameters mid-orbit: https://scratch.mit.edu/projects/56143060/

### Creating Elliptical Orbits

You might check out my orrery project here.

(Is this still relevant?)

Last edited by TheHockeyist (April 13, 2015 16:51:35)  ### Creating Elliptical Orbits

TheHockeyist wrote:

You might check out my orrery project here.

(Is this still relevant?)
Sure

bottom text