fix a bug: cos(radius) in distance.py