Jump to content
  • Advertisement
Sign in to follow this  
glSmurf

vector math

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!