Speed of object
Speed of object
I've got a vector which contains the speed of an object on the X,Y and Z-Axis. How can I get the "absolute" speed of this objects by using the X Y and Z Speed of it?
-
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada
I think you mean that you want to know the magnitude of the vector (ie the "length" of the line from your current position to the one indicated by the vector)?
Doing that, if I remember my math correctly, is fairly simple. Just square all the values, add them together, and then take the square root.
sqrt( x^2 + y^2 + z^2 )
For example, x = 2, y = 3, z = 4:
sqrt ( (2)^2 + (3)^2 + (4)^2 )
= sqrt( 4 + 9 + 16 )
= sqrt( 29 )
= ~5.4
Is this what you were looking for?
Doing that, if I remember my math correctly, is fairly simple. Just square all the values, add them together, and then take the square root.
sqrt( x^2 + y^2 + z^2 )
For example, x = 2, y = 3, z = 4:
sqrt ( (2)^2 + (3)^2 + (4)^2 )
= sqrt( 4 + 9 + 16 )
= sqrt( 29 )
= ~5.4
Is this what you were looking for?
-
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada