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.
NickyNouse
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
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.
gtoal
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
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)
Layzej
Here's one that lets you change the orbit parameters mid-orbit: https://scratch.mit.edu/projects/56143060/
TheHockeyist
CatsUnited
here.Sure You might check out my orrery project
(Is this still relevant?)