Breaking down forces in three dimensions.

  • Context: Undergrad 
  • Thread starter Thread starter Yevgeni
  • Start date Start date
  • Tags Tags
    Dimensions Forces
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 3K views
Yevgeni
Messages
2
Reaction score
0
Hello! This is my first post but definitely not my last.

I am programming a space simulator and my first problem to solve is to make gravitation work properly.

If I have two objects at arbitrary positions in three dimensional space I can calculate the net force between them in a straight line, but that does me no good for a Cartesian coordinate system. How do I break the forces down into three axes? I have found how to do this with two axes, but I can't apply this logic to three for some reason. Once I solve this problem I will put a "star" and a "planet" into my simulator and let you all know if I can make a stable orbit with this solution.
 
Physics news on Phys.org
The classical law of gravitation is F=G m1 m2 R/|R|^3 where F and R are vectors, so you represent them as F=[Fx, Fy, Fz] and R=[Rx, Ry, Rz]. F is the force on particle 1 (or 2) and R is the vector from particle 1 (or 2) to particle 2 (or 1). |R| is the absolute value of R which equals sqrt(Rx^2+Ry^2+Rz^2). So you really have three equations:

Fx = G m1 m2 Rx/|R|^3
Fy = G m1 m2 Ry/|R|^3
Fz = G m1 m2 Rz/|R|^3
 
This is exactly what I was looking for! I'm slightly confused, though. Isn't gravitation an inverse square relationship as opposed to inverse cube relationship?

At any rate, I'll plug this into my program and let you know my results.
 
Yevgeni said:
This is exactly what I was looking for! I'm slightly confused, though. Isn't gravitation an inverse square relationship as opposed to inverse cube relationship?

At any rate, I'll plug this into my program and let you know my results.

This is still inverse square, there is that R on top too. Its just that you have to specify the direction too, and to do that you multiply by R/|R| which is just one unit long