Difference between revisions of "UnitVector Command"

From GeoGebra Manual
Jump to: navigation, search
Line 11: Line 11:
 
; UnitVector[Vector]: Yields a vector with length 1, which has the same direction and orientation as the given vector.
 
; UnitVector[Vector]: Yields a vector with length 1, which has the same direction and orientation as the given vector.
 
: {{Example|1=<code>UnitVector[{a,b}]</code> returns ''{<math>\frac{a}{\sqrt{a²+b²&#125;}</math>,<math>\frac{b}{\sqrt{a²+b²&#125;}</math>}''.}}
 
: {{Example|1=<code>UnitVector[{a,b}]</code> returns ''{<math>\frac{a}{\sqrt{a²+b²&#125;}</math>,<math>\frac{b}{\sqrt{a²+b²&#125;}</math>}''.}}
 +
: {{Example|1=<code>UnitVector[{2,4,4}]</code> returns ''{<math>\frac{1}{3}</math>,<math>\frac{2}{3}</math>,<math>\frac{2}{3}</math>}''.}}

Revision as of 09:49, 23 August 2011


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] returns \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] returns \begin{pmatrix}0.8\\-0.6\end{pmatrix}.
UnitVector[Segment]
Yields the direction vector of the given segment, with length 1

CAS Syntax

In CAS View only one syntax is allowed:

UnitVector[Vector]
Yields a vector with length 1, which has the same direction and orientation as the given vector.
Example: UnitVector[{a,b}] returns {\frac{a}{\sqrt{a²+b²}},\frac{b}{\sqrt{a²+b²}}}.
Example: UnitVector[{2,4,4}] returns {\frac{1}{3},\frac{2}{3},\frac{2}{3}}.
© 2024 International GeoGebra Institute