Handbook
Glossary
distance ( u v -- x )
Factor handbook
»
The language
»
Numbers
»
Vector operations
»
Vector arithmetic
Prev:
p-norm ( k p -- x )
Next:
v~ ( a b epsilon -- ? )
Vocabulary
math
.
vectors
Inputs
u
a
sequence
of
number
s
v
a
sequence
of
number
s
Outputs
x
a non-negative real number
Word description
Outputs the Euclidean distance between two vectors.
Definition
IN:
math.vectors
GENERIC:
distance
( u v -- x )
Methods
USING:
math.vectors
sequences.cords
;
M:
cord
distance
v-
norm
;
inline
USING:
kernel
math
math.functions
math.vectors
sequences
;
M:
object
distance
[
-
absq
]
[
+
]
2map-reduce
sqrt
;
inline
USING:
math.vectors
math.vectors.simd
;
M:
simd-128
distance
v-
norm
;
inline