CoCalc Shared Filessl2R_geodesics.sagews
Author: Kyle Ormsby
Views : 26
Description: Geodesics, tangent, and normal vectors in the sl_2(R) model of the hyperbolic plane.
var('a,b,c,t'); #initialize variable names
w = 4; #plot size

hh = implicit_plot3d(-a^2-b*c-1,(a,-w,w),(b,-w,w/4),(c,0,w),alpha=0.5); #sl2R model of H^2
nn = implicit_plot3d(-a^2-b*c+1,(a,-w,w),(b,-w,w/4),(c,-w/4,w),color="darkgray",alpha=.25); #norm -1 surface

def geo(A,T,t_min,t_max): #parametric plot of geodesic passing through A in hh with tangent vector T such that <T,T>=-1

AA = (1,-1,2); TT = (0,sqrt(2)/2,sqrt(2)); #elements of sl2R, AA on hh and TT of norm -1 orthogonal to AA
ll = geo(AA,TT,-1.5,.8);

from sage.plot.plot3d.shapes2 import Line; #import Line function
vecAA = Line([(0,0,0),AA],arrow_head=True,thickness=5,color="red"); #graphical version of AA
vecTT = Line([(0,0,0),TT],arrow_head=True,thickness=5,color="red"); #graphical version of TT

def wedge(T,A): #wedge product of vectors T and A in sl2R
matT = matrix([[T[0],T[1]],[T[2],-T[0]]]);
matA = matrix([[A[0],A[1]],[A[2],-A[0]]]);
matWedge = 1/2*(matT*matA-matA*matT);
return (matWedge[0,0],matWedge[0,1],matWedge[1,0]);

NN = wedge(TT,AA); #normal vector to the geodesic through AA with tangent vector TT
vecNN = Line([(0,0,0),NN],arrow_head=True,thickness=5,color="red"); #graphical version of NN

basePic = hh+nn;
AAPic = ll+vecAA+vecTT+vecNN;

#now do it all again with different AA and TT:
aaa=-1/2; bbb = -3/4; ccc = 5/3;
AAA = (aaa,bbb,ccc);
ttt =-1/4; uuu = (3*ttt+3*sqrt(-4*ttt^2+5))/10; vvv = 4/3*(5*uuu/3-ttt); #fancy arithmetic to get TTT in AAA^\perp with norm -1
TTT = (ttt,uuu,vvv);
lll = geo(AAA,TTT,-1.8,0.9);
NNN = wedge(TTT,AAA);

AAAPic = vecAAA+vecTTT+lll+vecNNN;
totalPic = basePic+AAPic+AAAPic;
totalPic.show()
#blue = hh, gray = nn, green = geodesics, red arrows = ATN for one geodesic, blue arrows = ATN for other geodesic

(a, b, c, t)
3D rendering not yet implemented
︠90ff104f-2de4-47e6-a269-9f6f3cbeef99︠
︠2ffd5b51-a067-4f15-a8b6-73d4034d2fe7︠