Handbook
Glossary
ray-sphere ( sphere ray -- t )
Vocabulary
benchmark
.
raytracer
Inputs
sphere
an
object
ray
an
object
Outputs
t
an
object
Definition
USING:
kernel
math
math.functions
;
IN:
benchmark.raytracer
:
ray-sphere
( sphere ray -- t )
[
drop
]
[
sphere-b&v
]
2bi
[
drop
]
[
sphere-d
]
3bi
dup
0.0
<
[
3drop
1/0.
]
[
sqrt
sphere-t
nip
]
if
;
inline