A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [F8] planetary motion

  1. #1
    Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    37

    [F8] planetary motion

    I've been trying to make a flashmovie that shows how a planet moves around its star according to some phisical laws. I've looked up some tutorials on this sort of thing but they're not really handeling it in a way i want to. I want do be able to use actual (scaled) values for distances and masses and I also want to use Newton's gravitylaw.

    To use the gravity law i've set the planet's distance "r" to sqrt(_x^2 + _y^2)
    I've set it's angular speed "w" to v/r where i only defined "v" as sqrt(Gm/r)
    Then I defined its components as: vy=sin(p)*v and vx=cos(p)*v.

    My problem is that it needs to calculate the planets position as wel as its speed ervery time. I kinda lost the code so i don't know exactlywhat i did so far.

    To start things off, is it actually possible to use exactly these formulas?
    And how should i start?
    (visit www.stripsandsuch.nl.nu)

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Posts
    2,049
    here is a link that has the use of physics maybe it might help you. ( not sure )

    http://www.krazydad.com/bestiary/

  3. #3
    Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    37
    Thanks, thats an interesting site. However i think it's a bot too difficult for me to get the right stuff out of these codes. He uses some external files and certain codes I haven't seen yet.

    Eventually I can probebly understand quite a bit of these codes but for now its just too much work to figure it all out. Maybe someone can take some smaller steps toward my goal? I have to start with only two objects that's all, i'll work my way up from there.
    (visit www.stripsandsuch.nl.nu)

  4. #4
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Hi! Please see the FLA (F8) taken out from my library and attached to this post.
    Hope this is what you wanted!
    Last edited by Eager Beaver; 08-19-2007 at 02:23 PM.
    <signature removed by admin>

  5. #5
    Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    37
    That looks really nice, but its not what i mean. This seems to be a mathmatical function descibing circular motion. I want to use newton's law of gravity F = -(G*m1*m2)/(r^2) and the centripital force F = m* v^2/r. So that i get a motion that depends on how far the planet is from its star and how fast its moving around it. If for example you were to give it a speed too small it would crash into the planet's star or too great it would fly off. My goal is to make sort of an educational movie on planetary motion in which you can mess around with weight, velocity and distance.
    (visit www.stripsandsuch.nl.nu)

  6. #6
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    I know,
    m= mass
    r=radius
    v=velocity
    but what is G?
    <signature removed by admin>

  7. #7
    Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    37
    Gravitational constant: 6.76*10^-11 N.m^2.kg^-2
    (visit www.stripsandsuch.nl.nu)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center