| www.delorie.com/gnu/docs/calc/calc_48.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Duplicate the vector, compute its length, then divide the vector by its length: RET A /.
1: [1, 2, 3] 2: [1, 2, 3] 1: [0.27, 0.53, 0.80] 1: 1.
. 1: 3.74165738677 . .
.
r 1 RET A / A
|
The final A command shows that the normalized vector does indeed have unit length.
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |