Message181666
Sorry, I was wrong. I missed that z is in range -1..1. Original report is invalid, random.vonmisesvariate() always returns a value on the full circle.
However there is some inconsistency. For small kappa (<= 1e-6) result range is 0 to 2pi, for other kappa it is (mu%2pi)-pi to (mu%2pi)+pi. For consistency we should either shift a range for small kappa:
if kappa <= 1e-6:
return (mu % TWOPI) - _pi + TWOPI * random()
or normalize a result in another case:
if u3 > 0.5:
theta = (mu + _acos(f)) % TWOPI
else:
theta = (mu - _acos(f)) % TWOPI |
|
Date |
User |
Action |
Args |
2013-02-08 11:37:12 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson |
2013-02-08 11:37:12 | serhiy.storchaka | set | messageid: <1360323432.72.0.563989610494.issue17149@psf.upfronthosting.co.za> |
2013-02-08 11:37:12 | serhiy.storchaka | link | issue17149 messages |
2013-02-08 11:37:12 | serhiy.storchaka | create | |
|