Handbook
Glossary
h+ ( a b -- c )
Vocabulary
math
.
vectors
.
homogeneous
Inputs
a
an
object
b
an
object
Outputs
c
an
object
Definition
USING:
kernel
math
math.vectors
sequences
;
IN:
math.vectors.homogeneous
:
h+
( a b -- c )
2dup
[
(homogeneous-w)
]
bi@
over
=
[
[
[
(homogeneous-xyz)
]
bi@
v+
]
dip
suffix
]
[
drop
[
[
(homogeneous-xyz)
]
[
(homogeneous-w)
]
bi*
v*n
]
[
[
(homogeneous-w)
]
[
(homogeneous-xyz)
]
bi*
n*v
v+
]
[
[
(homogeneous-w)
]
[
(homogeneous-w)
]
bi*
*
suffix
]
2tri
]
if
;