UnitVector Command

From GeoGebra Manual
Jump to: navigation, search


UnitVector( <Vector> )
Yields a vector with length 1, which has the same direction and orientation as the given vector. The vector must be defined first.
Example:
Let v=\mathrm{\mathsf{ \begin{pmatrix}3\\4\end{pmatrix} }}. UnitVector(v) yields \mathrm{\mathsf{ \begin{pmatrix}0.6\\0.8\end{pmatrix} }}.
UnitVector( <Line> )
Yields the direction vector of the given line with length 1.
Example:
UnitVector(3x + 4y = 5) yields \mathrm{\mathsf{ \begin{pmatrix}0.8\\-0.6\end{pmatrix} }}.
UnitVector( <Segment> )
Yields the direction vector of the given segment with length 1.
Example:
Let s = Segment((1,1),(4,5)).
UnitVector(s) yields \mathrm{\mathsf{ \begin{pmatrix}0.6\\0.8\end{pmatrix} }}.


Note Hint: In the Menu view cas.svg CAS View three-dimensional vectors and vectors with undefined variables are also valid inputs.
Examples:
  • UnitVector((a, b)) yields (\mathrm{\mathsf{ \frac{a}{\sqrt{a a + b b}} }}, \mathrm{\mathsf{ \frac{b}{\sqrt{a a + b b}} }}).
  • UnitVector((2, 4, 4)) yields (\mathrm{\mathsf{ \frac{1}{3} }}, \mathrm{\mathsf{ \frac{2}{3} }}, \mathrm{\mathsf{ \frac{2}{3} }}).
© 2018 International GeoGebra Institute