-2
\$\begingroup\$

A body in a 3 dimensional friction-less environment experiences a force at 1 meter away from its center of mass, in a direction of a 90 degree offset from the direction of its center of mass.

This will cause the body to rotate, it will not move from its place.

If there is a new force introduced, on the other side of the center of mass but in the same direction, the rotation will be cancelled and instead the body will move in the direction of the force.

There are tonnes of physics examples out there dealing with one force on an object, I find nothing about how to sum up multiple forces into one though.

I'd like an example of how to sum up all forces affecting a body and translate that into how the body will change its momentum and accelerate

Examples in python preferred, examples in pure math are discouraged.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Have you ever heard of vectors ? \$\endgroup\$
    – dot_Sp0T
    Dec 5, 2017 at 21:26
  • 1
    \$\begingroup\$ "examples in pure math are discouraged" why? Vector mathematics is how physical interactions are calculated. You can't really divorce the two. \$\endgroup\$
    – Stephan
    Dec 5, 2017 at 22:14

1 Answer 1

1
\$\begingroup\$

First, you should learn how Torque and Angular momentum work, because the simple answer to your question is ("add the forces and add the torques, then integrate over time.")

I'd like an example of how to sum up all forces affecting a body

With a vector library, the actual math isn't that hard. for each individual force, the projection of that force onto the moment arm is the displacement force, and the cross product of that force and the moment arm is the torque vector.

Vector3 centerOfMass;
List<(Vector3, Vector3)> forceOnPointPairs;

totalForce = sum(dot(f, (pt - centerOfMass)) / length(pt - centerOfMass) for f, pt in forceOnPointPairs)
totalTorque = sum(cross(f, pt - centerOfMass) for f, pt in forceOnPointPairs)

How the body will change its momentum and accelerate.

This is called integration - in very basic pseudocode, you can think of it as an update loop logic like

def update(deltaTime):
   acceleration = sum(forces) / mass
   velocity += deltaTime * acceleration
   position += deltaTime * velocity

   angular_acceleration = sum(torques) / moment_of_inertia
   angular_velocity += deltaTime * angular_acceleration
   orientation += angular_velocity // warning: this bit is hand-wavy

I've hand-waved the orientation line because the actual implementation depends on how you store the orientation. For a more complete picture, a good series of article to read on this topic is at Gaffer on Games:

Integrating Position and issues with Euler Integration: https://gafferongames.com/post/integration_basics/

Integrating Rotation: https://gafferongames.com/post/physics_in_3d/

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .