Handbook
Glossary
normalize ( v -- w )
Factor handbook
»
The language
»
Numbers
»
Vector operations
»
Vector arithmetic
Prev:
vtruncate ( v -- w )
Next:
vneg ( v -- w )
Vocabulary
math
.
vectors
Inputs
v
a
sequence
of at least 1 non-zero number
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
l2-norm
v/n
;
inline