Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Creating Elliptical Orbits
- CatsUnited
-
1000+ posts
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.
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
- NickyNouse
-
1000+ posts
Creating Elliptical Orbits
If the ellipse can be stretched only on the x or y axis, try:
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.
forever
set [i v] to [1]
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)
end
end
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.
- CatsUnited
-
1000+ posts
Creating Elliptical Orbits
Okay, I'll test it out soon. If the ellipse can be stretched only on the x or y axis, try:forever
set [i v] to [1]
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)
end
end
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.
bottom text
- gtoal
-
1000+ posts
Creating Elliptical Orbits
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)
- CatsUnited
-
1000+ posts
Creating Elliptical Orbits
I won't be on the computer again for about 14 hours.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)
bottom text
- Layzej
-
100+ posts
Creating Elliptical Orbits
Here's one that lets you change the orbit parameters mid-orbit: https://scratch.mit.edu/projects/56143060/
- TheHockeyist
-
1000+ posts
Creating Elliptical Orbits
Last edited by TheHockeyist (April 13, 2015 16:51:35)
- CatsUnited
-
1000+ posts
Creating Elliptical Orbits
here.Sure You might check out my orrery project
(Is this still relevant?)
bottom text
- Discussion Forums
- » Advanced Topics
-
» Creating Elliptical Orbits