Created
August 13, 2017 19:50
-
-
Save vlavorini/5f811189da184a3a1900d5e982d2d9f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _dist_poinc(a, b): | |
num=np.dot(a-b, a-b) | |
den1=1-np.dot(a,a) | |
den2=1-np.dot(b,b) | |
return np.arccosh(1+ 2* (num) / (den1*den2)) | |
def dist_poinc(a, A): | |
res=np.empty(A.shape[0]) | |
for i, el in enumerate(A): | |
res[i]=_dist_poinc(a, el) | |
return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment