update dist, angle function