Difference between revisions of "UnitVector Command"
From GeoGebra Manual
Line 5: | Line 5: | ||
; UnitVector[Line]: Yields the direction vector of the given line, with length 1 . | ; UnitVector[Line]: Yields the direction vector of the given line, with length 1 . | ||
; UnitVector[Segment]: Yields the direction vector of the given segment, with length 1 | ; UnitVector[Segment]: Yields the direction vector of the given segment, with length 1 | ||
− | ==CAS | + | ==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]: 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²}}</math>,<math>\frac{b}{\sqrt{a²+b²}}</math>}''.}} | : {{Example|1=<code>UnitVector[{a,b}]</code> returns ''{<math>\frac{a}{\sqrt{a²+b²}}</math>,<math>\frac{b}{\sqrt{a²+b²}}</math>}''.}} |
Revision as of 15:06, 11 August 2011
- UnitVector[Vector]
- Yields a vector with length 1, which has the same direction and orientation as the given vector.
- Example:
UnitVector[{2, 4, 4}]
returns {\frac{1}{3}, \frac{2}{3}, \frac{2}{3}}.
- UnitVector[Line]
- Yields the direction vector of the given line, with length 1 .
- 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²}}}.