Sharedhyperbolic.sagewsOpen in CoCalc
Author: Richard Ketchersid
Description: Beltrami Hyperbolic Plane
x,y,z = var('x, y, z') Z(x,y) = sqrt(x^2 + y^2 + 1) x1, y1 = [3, 4] x2, y2 = [5, 7] p1 = [x1,y1,Z(x1,y2)] p2 = [x2,y2,Z(x2,y2)] xhat(x,y) = x/(Z(x,y)+1) yhat(x,y) = y/(Z(x,y)+1) q1 = [xhat(x1,y1),yhat(x1,y1)] q2 = [xhat(x2,y2),yhat(x2,y2)] v = vector([x, y, z]) v1 = vector(p1) v2 = vector(p2) n = v1.cross_product(v2) a = n[0] b = n[1] c = n[2] p(x,y) = c*x^2 + c*y^2 + 2*a*x + 2*b*y + c r(x,y) = x^2 + y^2 - 1
G = implicit_plot(p == 0, (x,-1,1),(y,-1,1)) G += implicit_plot(r == 0, (x,-1,1),(y,-1,1)) G += points([q1,q2], color = 'red') G.show()
var('z') H = implicit_plot3d(x^2 + y^2 - z^2 == -1, (x,-10,10),(y,-10,10),(z,-1,10), opacity = .5) H += implicit_plot3d(n*v == 0,(x,-10,10),(y,-10,10),(z,-1,10),opacity = .5,color = 'orange' ) H += point3d([p1,p2], color='red') H.show()
z
3D rendering not yet implemented
p
(x, y) |--> -2*x