A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Angular vs Linear velocity

  1. #1
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697

    Angular vs Linear velocity

    At the moment I only calculate linear acceleration, but I'd like to add angular acceleration to the mix. When a force acts on an rigidbody it creates accelleration, but how much of that accelleration is angular and how much is linear?



    The resultant velocities of the three rectangles in the figure is obvious to me, but how do I go about calculating this? I'd also like to know what to do with forces coming in at another angle.

  2. #2
    Viral tick lordofduct's Avatar
    Join Date
    May 2008
    Location
    South Florida
    Posts
    159
    I've seen you ask quite a few questions around here TODorus, and I've come to the conclusion you know quite a bit of your stuff.

    There is a lot of things to assume when considering an "angular collision". Center of mass, momentum/innertia, etc. Oh and we can't forget friction... which throws a huge freakin' wrench in the whole issue.

    But another big problem is the cause of the force. Let's consider for a moment an abstract force that only pushes in a direction but has no actual volume so that the rotating body can pass through it...

    Take a pack of smokes (I say a pack of smokes cause I have a full pack sitting in front of me all handy and such). Let's now flick this pack of smokes really hard at a corner and withdraw our finger from the scenario. You will notice the body rotates rather quickly around its center of mass and moves forward rather slowly.

    Lets flick it again closer to the center like in image 1 (left image). Not exactly the center, but damn close. You will notice it rotates slowly about its center of mass, but most of the velocity is directed towards moving forward.

    Ok, but not a lot of forces actually occur like this in a physics engine. Or in real life as well. Most forces occur due to collision, and that colliding object takes up volume. So lets try this same scenario again with the pack of smokes and now instead take your finger and push on the corner with out removing it from the scenario.

    What happens? It pivots around the point of collision! For a moment and then gradually starts to pivot around the center of mass as you retract your finger from the system (like what would happen where to free moving objects collide... the inertia of both would be split between the two sending them away from each other).

    But then what about a third scenario. A static object. take you pack of smokes and drop it at the corner of your desk and let it collide with the corner of the smokes. Again during the collision it pivots around the point of collision, then once it passes the desk it starts rotate in an ablong circle. A lot of stuff actually happens in this collision (some of the reactions caused by gravity itself... but it gives you an idea).

    So right there we know that there is a lot of scenarios that can occur first off with relation to the angular collision.


    Anyways, these scenarios might give you a starting stone to hop off of... try reading about collisions and angular collisions in physics and I'll probably be back with more ideas. I have to go outside now and paint my house so we can hang the accordian hurricane shutters.
    I do not vow to know everything, and I can not guarantee what I say is correct. We are all learning, and I actually thank you the one with the questions for asking and stimulating my mind.

    www.lordofduct.com - check out my blog, or contact me through my website. I'm always available for freelance work in Flex3/Actionscript 3.

    how many times must I say it... the livedocs are your friend!
    http://livedocs.adobe.com/flash/9.0/...l-classes.html

  3. #3
    Senior Member
    Join Date
    May 2006
    Location
    Manhattan
    Posts
    246
    let's say you have a rigid body, b and a force f being applied at a point Q (relative to the body). you want to solve for the acceleration (linear and angular) induced by f.

    the change in linear acceleration, regardless of point of application:
    delta a = f / b.mass
    this may be unintuitive at first, but lordofduct gave a nice intuitive description that should lead to you thinking about it in the right way.

    the change in angular acceleration can be solved for by finding the dot product of the vector perpendicular to that pointing from b's center of mass to the point Q:
    delta w = dot( perp( Q ), f ) / b.inertiaTensor
    to understand the basics of this you have to consider a geometric property of the dot product- when 2 vectors are perpendicular, their dot product is 0. so basically this "scales" the change in angular acceleration by how perpendicular the force's direction at the point of application is from the center of mass. if the force is applied at a point such that the force vector points directly at the center of mass- the dot product of that force and a vector perpendicular to the point will result in no angular acceleration.

    just in case- dot product is the sum of a vector's componentwise multiplication- in 2D:
    v1.x * v2.x + v1.y * v2.y

    and a vector perpendicular to another vector is:
    either (-vector.y, vector.x) or (vector.y, -vector.x)
    Last edited by newblack; 09-07-2008 at 08:10 PM.

  4. #4
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Thanks for the help guys! I did see your replies days ago, but I had to study all week. Finally had a go at it today. I made a small testversion which works quite nicely thus far. TestBed (ARROWS or WASD to control).

    Quote Originally Posted by lordofduct
    I've seen you ask quite a few questions around here TODorus, and I've come to the conclusion you know quite a bit of your stuff.
    Actually, I've come to the conclusion I've forgotten quite a bit of my stuff. Al starting to remember it from High School And in reply to that comic on the purity of the fields of sience. I study Communication Science which most of the time is.... applied sociology.

    Quote Originally Posted by newblack
    to understand the basics of this you have to consider a geometric property of the dot product- when 2 vectors are perpendicular, their dot product is 0. so basically this "scales" the change in angular acceleration by how perpendicular the force's direction at the point of application is from the center of mass.
    I thought about faking it that way, but that really is how it works? I didn't expect it to be that simple. Thanks Newblack!

    Quote Originally Posted by lordofduct
    What happens? It pivots around the point of collision! For a moment and then gradually starts to pivot around the center of mass as you retract your finger from the system (like what would happen where to free moving objects collide... the inertia of both would be split between the two sending them away from each other).
    From what I understand by using my fists as an example (not a smoker), the pivoting around the point of collision originates the same way as using forces to move the object. Say 2 packs of smokes are moving toward each others side, hitting each other in the top and bottom corners respectivly. The liniear velocities would be used as the forces acting on the packs.

    I wouldn't know what to do with angular velocities as of yet. I'm thinking of two situations:
    1 A bat hitting a baseball
    2 A spinning ball hitting another ball

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