Fix bug in randArc

This commit is contained in:
2022-06-16 12:40:27 +01:00
parent 4d6e547b74
commit 2bc30d0a6b
3 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -66,13 +66,13 @@ randProb p = do
return (p1 < p)
randInCirc :: RandomGen g => Float -> State g Point2
randInCirc = randInArc (2*pi)
randInCirc rad = randInArc rad (2*pi)
randInArc :: RandomGen g => Float -> Float -> State g Point2
randInArc = randInArcStrip 0
randInArcStrip :: RandomGen g => Float -> Float -> Float -> State g Point2
randInArcStrip minrad maxangle maxRad = do
randInArcStrip minrad maxRad maxangle = do
rad <- state $ randomR (minrad,maxRad)
ang <- state $ randomR (0,maxangle)
return $ rad *.* unitVectorAtAngle ang