Add more wall reflection/randomisation
This commit is contained in:
@@ -121,3 +121,14 @@ randsSpread (a, b) i
|
||||
|
||||
randsOnCirc :: RandomGen g => Int -> State g [Float]
|
||||
randsOnCirc = randsSpread (0, 2 * pi)
|
||||
|
||||
randPeakedParam :: RandomGen g => Int -> Float -> Float -> Float -> State g Float
|
||||
randPeakedParam i a b c = do
|
||||
x <- state $ randomR (-1, 1)
|
||||
let y = x ^ i
|
||||
return $ if y < 0
|
||||
then a + y * (a-b)
|
||||
else b + y * (c-b)
|
||||
|
||||
randPeaked :: RandomGen g => Float -> Float -> Float -> State g Float
|
||||
randPeaked = randPeakedParam 3
|
||||
|
||||
Reference in New Issue
Block a user