In LaTeX, there are several ways to represent unit vectors, depending on whether you use built-in commands or external packages.
Using Default LaTeX Commands
One common method is the hat notation, which places a small hat symbol above a letter. This is done using the \hat{}
command.
\[ \hat{a}=\frac{\vec{a}}{\left | \vec{a} \right |} \]
Output :
Rectangular unit components
In 3D space, the standard rectangular unit vectors are represented with a hat symbol above the letters i, j, and k.
\[ \left ( \hat{i},\hat{j},\hat{k} \right ) \]
Output :
Expressing Position in 3D Space
In three-dimensional space, a position vector is used to describe a point’s location. It is written as a combination of its x, y, and z components along the respective coordinate axes.
\[ \vec{r}=x\hat{i}+y\hat{j}+z\hat{k} \]
Output :
Here, x, y, and z are the respective coordinates, while \hat{i}
, \hat{j}
, and \hat{k}
indicate the directions of these components.
Alternative Notations for Directional vectors
Some advanced mathematics and physics texts use ex, ey, ez instead of i
, j
, k
.
\[ \left( \hat{e}_x,\hat{e}_y,\hat{e}_z \right) \]
Output :
This notation is commonly found in higher-level calculus and theoretical physics.
All the commands used so far are built into LaTeX by default, and no external packages were required.
Using the Physics Package for Simplified Notation
The physics
package in LaTeX provides a convenient way to define vectors and other mathematical notations with minimal effort.
To use the unit vector notation, install the physics package and apply the \vu*{}
command.
\documentclass{article}
\usepackage{physics}
\begin{document}
\[ \vu*{a}=\frac{\va*{a}}{\abs{\va*{a}}} \]
\end{document}
Output :
Observe the LaTeX code above. The \va*{}
command represents vectors, while \abs{}
denotes absolute values.