Sign in to follow this  
glSmurf

vector math

Recommended Posts

how do I divide a vector into two components? In my case I need to know the force along a certain axis. for instance: Vector Force = (0, 10, 10); Vector Axis = (0, 0, 1); the result here is would be (0, 0, 10) ( and the other component (0, 10, 0) ) I've seen a formula for this once in a book ..cant remember which one though =/

Share this post


Link to post
Share on other sites
Assuming your Axis vector is normalised (i.e. its length is 1) you can get the length of the Force vector projected onto the Axis vector by taking the dot product of the two. So to get the projected component of the force vector on the Axis vector multiply that length by the Axis vector.

Essentially what MickePicke said... but you can miss out the division by length term if your axis vector is normalised.

Projected Vector = dot(Vector Force, Vector Axis) * Vector Axis
Second Component = Vector Force-Projected Vector

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this