Handbook
Glossary
von-mises-random* ( mu kappa rnd -- n )
Vocabulary
random
Inputs
mu
an
object
kappa
an
object
rnd
an
object
Outputs
n
an
object
Definition
USING:
combinators.short-circuit
kernel
math
math.constants
math.functions
;
IN:
random
::
von-mises-random*
( mu kappa rnd -- n )
kappa 0.000001
<=
[
2pi
rnd
random-unit*
*
]
[
4.0 kappa
sq
*
1.0
+
sqrt
1.0
+
:>
a a 2.0 a
*
sqrt
-
2.0 kappa
*
/
:>
b b
sq
1.0
+
2.0 b
*
/
:>
r 0
:>
c! 0
:>
_f!
[
rnd
random-unit*
{
[
2.0 c
-
c
*
<
]
[
1.0 c
-
e^
c
*
<=
]
}
1||
not
]
[
rnd
random-unit*
pi
*
cos
:>
z r z
*
1.0
+
r z
+
/
_f! r _f
-
kappa
*
c!
]
do
while
mu
2pi
mod
_f
cos
rnd
random-unit*
0.5
>
[
+
]
[
-
]
if
]
if
;