Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Formula for gravity

Discussion in 'General Discussion' started by ColossalDuck, Mar 16, 2010.

  1. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    The formula for gravity is this:
    Code (csharp):
    1. F = {G([m1][m2])}/
    2.  
    3. F: is the magnitude of the gravitational force between the two point masses,
    4. G: is the gravitational constant,
    5. m1: is the mass of the first point mass,
    6. m2: is the mass of the second point mass, and
    7. d: is the distance between the two point masses.
    The things I am having trouble with is, how would you find the gravity if there is only 1 mass, and how do you figure out F if you do not know G and vice versa?

    No this isn't homework but I am curious as (that place everyone talks about) and I like theory!
     
  2. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    If you only have 1 mass, how do you have a distance value? If I remember my physics 12, distance is the length between the two bodies.

    Unless you mean the mass of the object rather than a "mass" refering to another object...but there's no reason you wouldn't be able to have that. There would be other ways to solve for mass though...
     
  3. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Oops, forgot about distance. Hmm, well I suppose having 2 objects is fine. But getting the gravity of just the one object is the problem. How do you do this? Is there a separate formula for gravity with one object?
     
  4. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    No, because gravity is the force that pulls two objects together. The force would be the same (maybe, physics 12 is getting dimmer) I think...but the acceleration would be different because F=ma.

    I could be wrong, but that's my best guess. Is this for a game, or do you have a context for the problem you want to solve?
     
  5. Lab013

    Lab013

    Joined:
    Oct 22, 2008
    Posts:
    405
    A gravitational fields strength depends purely on the mass. How strong each unit of mass is in a gravitational field depends purely on what unit of measurement you are using.

    As for figuring out the force of gravity with just knowing the distance, I believe you are missing too many variables to give an answer.
     
  6. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Ok, thanks. Helps a lot, :D .

    Game idea in the future. For now its just been buzzing in my mind.

    Ya, thought so.

    You guys have helped a lot and I figured out how the theory for implementing this in my game. Better write it down in me theories book, item # ?>1
     
  7. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    Gravity, the fourth force, still very fascinating.

    The correct formula depends on the scale and complexity of your model (Newton or Einstein. Or you loose yourself in 11 dimensional string theory. Normally you're fine caring about masses and distance and so density.

    I'm somehow sure things look quite different again if you're for instance inside a black hole. *wooohoohhh* :O)
     
  8. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Lol, that would not be fun. Would be interesting though.
     
  9. rom

    rom

    Joined:
    Jul 2, 2006
    Posts:
    265
  10. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Ya, but what section would you put it in?
     
  11. rom

    rom

    Joined:
    Jul 2, 2006
    Posts:
    265
    i would pick scripting
     
  12. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    But this is just theory, not even coding purposes... yet
     
  13. rom

    rom

    Joined:
    Jul 2, 2006
    Posts:
    265
    in that case you can just think about
    and don't need any values for you formula
    ;)
    the theories of gravity are extensively discussed at
    http://en.wikipedia.org/wiki/Gravity

    edit. i see where you are going wrong
    if you only have one mass, there is no force to speak of unless perhaps you after quantum gravity, but i can't help you there

    In Newton's theory of gravitation
    gravity is a force produced by interacting masses (plural)

    In Einstein's General relativity
    it is a unit of space/time curvature
     
  14. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
  15. rom

    rom

    Joined:
    Jul 2, 2006
    Posts:
    265
  16. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    It is also generally accepted that, if the difference between the masses of the two bodies is large, then the mass of the smaller is negligible. For example, on Earth, it doesn't make any measurable difference that a car's mass is so much greater than mine. The difference between the gravitational force between the Earth and me and that between the Earth and the car is so minute, it is immeasurable by any practical means.

    So, Unity doesn't concern itself with the calculation for gravitational force. That's why it is left to us to define it. It only asks for the mass of rigidbodies to account for inertia/momentum.