2
$\begingroup$

I have a velocity vector on $X$, $Y$ and $Z$ axes. The values are represented as M/S (meters per second).

What algorithm should I use to convert this vector into a general MPH (miles per hour) value that takes into account all axes of the vector?

This may (or may not) be a very simple question. But I am far from being a genius at math! So apologies.

Thanks very much.

1 Answers 1

2

Multiply each coordinate by 2.23693629. In general, to convert units of a vector, you just convert units of each coordinate. This works because scalar multiplication by positive constants preserves direction, and because lengths of vectors and scalar multiplication are related by $\|c v\|=|c|\|v\|$. Scalar multiplication in this case just means multiplying each coordinate by the conversion factor.

  • 0
    I forgot to mention that I was already aware of the 2.2369 constant for M/S to MPH conversion. The thing I'm most interested in is how I can convert the XYZ velocity vector into a scalar MPH value. I have tried just using addition but this is proving to be incorrect.2010-11-06
  • 0
    @Nathan: I expected that you would know the conversion factor, which is not the point of my answer. I thought you wanted the converted vector, but apparently you just wanted the length of the converted vector. Do you know how to find the length of a vector? You could either multiply by 2.2369, then find the length, or find the length (in m/s), then multiply by 2.2369.2010-11-06
  • 0
    At the moment I am doing, psuedo: (Abs(vx) + Abs(vy) + Abs(vz)) * 2.2369. But this is proving to provide incorrect.2010-11-06
  • 0
    For a vector with only an $x$ component, you just take the absolute value to get the length. For a vector with only $x$ and $y$ components, then using the Pythagorean theorem you can see that the length of the vector is the the square root of the sum of the squares of the components. With a slightly more elaborate picture you can apply the Pythagorean theorem again to get the same result in general, so you should have $2.2369\sqrt{v_x^2+v_y^2+v_z^2}$.2010-11-06
  • 0
    I recommend this article: http://en.wikipedia.org/wiki/Euclidean_vector2010-11-06
  • 0
    Brilliant that works like a charm! My psuedo is: Sqrt(Abs(velocity_x * velocity_x) + Abs(velocity_y * velocity_y) + Abs(velocity_z * velocity_z))) * 2.23692010-11-06
  • 2
    @Nathan: You don't need the Abs() around the squares, as the square of a real number is necessarily non-negative.2010-11-06