Difference between revisions of "UnitVector Command"

From GeoGebra Manual
Jump to: navigation, search
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=4.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude>
 
<noinclude>{{Manual Page|version=4.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude>
 
{{command|vector-matrix}}
 
{{command|vector-matrix}}
; 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.  
+
;UnitVector[ <Vector> ]
: {{Example|1=Let ''v=<math>\begin{pmatrix}3\\4\end{pmatrix}</math>. <code>UnitVector[v]</code> returns ''<math>\begin{pmatrix}0.6\\0.8\end{pmatrix}</math>''.}}
+
:Yields a vector with length 1, which has the same direction and orientation as the given vector. The vector must be defined first.  
; UnitVector[Line]: Yields the direction vector of the given line, with length 1 .
+
:{{example|1=<div>Let ''v=<math>\begin{pmatrix}3\\4\end{pmatrix}</math>. <code><nowiki>UnitVector[v]</nowiki></code>http://www.geogebra.org/ggb.xsd''<math>\begin{pmatrix}0.6\\0.8\end{pmatrix}</math>''.</div>}}
: {{Example|1=<code>UnitVector[3x + 4y = 5]</code> returns ''<math>\begin{pmatrix}0.8\\-0.6\end{pmatrix}</math>''.}}
+
;UnitVector[ <Line> ]
; UnitVector[Segment]: Yields the direction vector of the given segment, with length 1
+
:Yields the direction vector of the given line, with length 1 .
 
+
:{{example|1=<div><code><nowiki>UnitVector[3x + 4y = 5]</nowiki></code> http://www.geogebra.org/ggb.xsd''<math>\begin{pmatrix}0.8\\-0.6\end{pmatrix}</math>''.</div>}}
 +
;UnitVector[ <Segment> ]
 +
:Yields the direction vector of the given segment, with length 1.
 
==CAS Syntax==
 
==CAS Syntax==
 
In [[CAS View]] only one syntax is allowed:
 
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.
+
;UnitVector[ <Vector> ]
: {{Example|1=<code>UnitVector[{a,b}]</code> returns ''{<math>\frac{a}{\sqrt{+&#125;}</math>,<math>\frac{b}{\sqrt{+&#125;}</math>}''.}}
+
:Yields a vector with length 1, which has the same direction and orientation as the given vector.
: {{Example|1=<code>UnitVector[{2,4,4}]</code> returns ''{<math>\frac{1}{3}</math>,<math>\frac{2}{3}</math>,<math>\frac{2}{3}</math>}''.}}
+
:{{example|1=<div><code><nowiki>UnitVector[{a, b}]</nowiki></code> yields ''{<math>\frac{a}{\sqrt{a^{2} + b^{2}&#125;}</math>, <math>\frac{b}{\sqrt{a^{2} + b^{2}&#125;}</math>}''.</div>}}
 +
:{{example|1=<div><code><nowiki>UnitVector[{2, 4, 4}]</nowiki></code> http://www.geogebra.org/ggb.xsd''{<math>\frac{1}{3}</math>, <math>\frac{2}{3}</math>, <math>\frac{2}{3}</math>}''.</div>}}

Revision as of 13:04, 6 September 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]http://www.geogebra.org/ggb.xsd\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] http://www.geogebra.org/ggb.xsd\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}] yields {\frac{a}{\sqrt{a^{2} + b^{2}}}, \frac{b}{\sqrt{a^{2} + b^{2}}}}.
Example:
UnitVector[{2, 4, 4}] http://www.geogebra.org/ggb.xsd{\frac{1}{3}, \frac{2}{3}, \frac{2}{3}}.
© 2024 International GeoGebra Institute