Handbook
Glossary
factorcode.org
normalize ( v -- w )
Factor handbook
»
The language
»
Numbers
»
Vector operations
»
Vector arithmetic
Prev:
norm-sq ( v -- x )
Next:
p-norm ( v p -- x )
Vocabulary
math.vectors
Inputs
v
a sequence of numbers, not all zero
Outputs
w
a
sequence
of
number
s
Word description
Outputs a vector with the same direction as
v
but length 1.
Definition
USING:
kernel
;
IN:
math.vectors
:
normalize
( v -- w )
dup
norm
v/n
;
inline