# How to correctly show units with a vector

Supposed I have an position vector $$\vec{r}=\begin{pmatrix} 10.0 & -30.0 & 25.0\end{pmatrix}$$ expressed in $\mathrm{millimeters}$.

What is the correct notation to display $\vec{r}$

1. $\begin{pmatrix} 10.0 & -30.0 & 25.0\end{pmatrix}\text{ mm}$
2. $\begin{pmatrix} 10.0\text{ mm} & -30.0\text{ mm} & 25.0\text{ mm}\end{pmatrix}$
3. $\begin{pmatrix} 10.0 & -30.0 & 25.0\end{pmatrix}\text{ in }\mathrm{mm}$

If the answer is 2. then why add all those redundunt units when all elements of a vector have to be of the same unit. If you have a long list of values then usualy you present this a table with the units in the header (and not on each element). What if the units are complex (with powers and fraction), do we really have to write them out for each element?

How would you consicely write out a vector while describing the units those values are in also at the same time?

PS. I did not post this in the `Math SE` because they have never heard of units :-) and only physics deals with real situations.

-
I think the correct notation is the second because the dimension of each component is a length. – Andrea Amoretti Jan 13 '11 at 18:43

1
From a typesetting point of view I think you want $123.45\text{ mm}$ rather than $123.45\text{mm}$. To get this in LaTeX consider `123.45\text{ mm}`. This applies to your form #1 as well: it should be $(10.0, -30.0, 25.0)\text{ mm}$. You'll also note that I like commas in vector expansions performed inline (but not in matrices in general). – dmckee♦ Jan 13 '11 at 18:50

2
If you have a units package like `siunitx` available in LaTeX you can write `\SI{123.45}{mm}` and it will add the space automatically. If there's no units package available, I usually use `123.45\,\mathrm{mm}` although I guess it doesn't really matter whether you use that or dmckee's method (which is a little shorter) - nobody here is going to complain about having the wrong size space in your measurements! – David Zaslavsky♦ Jan 13 '11 at 19:02

## 4 Answers

I would say 1. and 2. are correct. In the first you are multiplying by the scalar 1 mm.
Also elements of vectors dont need to have the same units.
Just consider the 4-vector (3 sec, 1 µm, 82 ly, 5.6 parsec)

-

1
Although technically you're right about units, in that it is possible to perform well-defined operations on vectors in which the components have different units, it's a major pain in the butt when you're working with linear transformations. It also requires you to introduce a non-identity metric to take the inner product. So in practice usually we normalize the units so that they're the same on all components. – David Zaslavsky♦ Jan 13 '11 at 19:00
The 4-vector above is a block-vector, with 1 time + 3 position quantities. Those do not behave like regular vectors because you cannot get a magnitude out of them without a non-scalar metric (as mentioned elsewhere correctly). In a pure sense a vector has to have the same units, although when it comes to SI prefixes it get complicated like (1 μm,1 km,1 ly) ?? – ja72 Jan 13 '11 at 19:26
@jalexiou: then you should make that clear. I thought $c = 1$ is implied ;-) – Marek Jan 13 '11 at 22:42
@jalexiou: sorry, I didn't notice you are not an author of this answer. In that case, I don't know why you think $c = 1$ is not implied :-) – Marek Jan 13 '11 at 22:44

I write it as 10i + 20j + 5k and set the scale somewhere before the calculations. Of course, you could add it after the vector, but that just doesn't look neat and tidy.

Or you could write the unit vector on the side and multiply the magnitude (with correct units) into it. That could also clarify things. I guess it just depends on how you grasp things and what's clearer to you. As long as you keep others in the loop then it should be okay.

-
I have to ask something though, what's the shortcode for writing i-cap in latex? – Anna Jan 13 '11 at 19:12

2
I think what you're looking for is \hat{\imath}. (Looks like: $\hat{\imath}$) The "\imath" is an undotted i, so you get the hat without the dot. (There's also a \jmath: $\jmath$.) – Matt Reece Jan 13 '11 at 21:16

Both 1 and 2 are perfectly fine notation. As someone who teaches introductory physics a lot, I would use either in class and accept either as correct from a student. #3 expresses the meaning perfectly clearly but is not the usual form of expression. I would certainly have no problem if a student wrote that in my class, for instance.

-

The correct notation is that of multiplying the whole thing by a unit (as a multiplication constant):

`(a,b,c)*mm`

-

So how would you show (1 mile, 1 mm, 1 angstrom) in the same vector? I wonder...  Maybe (1,0,0)*mile. – ja72 Jan 15 '11 at 0:46
think of units as of multiplication by unknown constant. You can put it inside, outside, whereever you want. – Pavel Radzivilovsky Jan 16 '11 at 23:20
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 12, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.942842423915863, "perplexity_flag": "middle"}