Difference between revisions of "UnitVector Command"
From GeoGebra Manual
m (→CAS Syntax) |
m (missing '') |
||
Line 3: | Line 3: | ||
;UnitVector[ <Vector> ] | ;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. | :Yields a vector with length 1, which has the same direction and orientation as the given vector. The vector must be defined first. | ||
− | :{{example|1=<div>Let ''v=<math>\begin{pmatrix}3\\4\end{pmatrix}</math>. <code><nowiki>UnitVector[v]</nowiki></code> yields ''<math>\begin{pmatrix}0.6\\0.8\end{pmatrix}</math>''.</div>}} | + | :{{example|1=<div>Let ''v=<math>\begin{pmatrix}3\\4\end{pmatrix}</math>''. <code><nowiki>UnitVector[v]</nowiki></code> yields ''<math>\begin{pmatrix}0.6\\0.8\end{pmatrix}</math>''.</div>}} |
;UnitVector[ <Line> ] | ;UnitVector[ <Line> ] | ||
:Yields the direction vector of the given line, with length 1 . | :Yields the direction vector of the given line, with length 1 . |
Revision as of 14:52, 14 December 2012
- 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=\begin{pmatrix}3\\4\end{pmatrix}.
UnitVector[v]
yields \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 \begin{pmatrix}0.8\\-0.6\end{pmatrix}.
- UnitVector[ <Segment> ]
- Yields the direction vector of the given segment, with length 1.
CAS Syntax
- UnitVector[ <Vector> ]
- Yields a vector with length 1, which has the same direction and orientation as the given vector.
- Example:
UnitVector[(a, b)]
yields {\frac{a}{\sqrt{a^{2} + b^{2}}}, \frac{b}{\sqrt{a^{2} + b^{2}}}}.
- Example:
UnitVector[(2, 4, 4)]
yields {\frac{1}{3}, \frac{2}{3}, \frac{2}{3}}.