This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients mark.dickinson, rhettinger, serhiy.storchaka
Date 2013-02-08.11:37:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360323432.72.0.563989610494.issue17149@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-02-08 11:37:12serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, mark.dickinson
2013-02-08 11:37:12serhiy.storchakasetmessageid: <1360323432.72.0.563989610494.issue17149@psf.upfronthosting.co.za>
2013-02-08 11:37:12serhiy.storchakalinkissue17149 messages
2013-02-08 11:37:12serhiy.storchakacreate