-
Hi, first of all I would like to thank you for your really useful code. I use it to illustrate some of the constructions in the Poicaré disk model :) I am also a beginner in Python programming, so maybe my problem will be trivial, but I would greatly appreciate your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'm glad it's useful to you. You can find the ideal points of a line by creating a from hyperbolic.poincare import shapes
point1 = shapes.Point.fromEuclid(-0.2, 0.1)
point2 = shapes.Point.fromEuclid(0.2, 0.5)
# Calculate ideal points
line = shapes.Line.fromPoints(*point1, *point2, segment=False)
ideal1 = line.startPoint() # The ideal point closer to point1
ideal2 = line.endPoint() # The ideal point closer to point2
# Draw
from hyperbolic import euclid
import drawSvg as draw
d = draw.Drawing(2.1, 2.1, origin='center')
d.draw(euclid.shapes.Circle(0, 0, 1), fill='#eee')
d.draw(line, hwidth=1/8, fill='black')
d.draw(point1, hradius=0.1, fill='green')
d.draw(point2, hradius=0.1, fill='red')
d.draw(ideal1, radius=0.02, fill='lime')
d.draw(ideal2, radius=0.02, fill='orange')
# Display
d.setRenderSize(w=400)
d.savePng('idealPoints.png')
d The calculation that determines the euclidean coordinates of the ideal points for the drawing is here. |
Beta Was this translation helpful? Give feedback.
I'm glad it's useful to you. You can find the ideal points of a line by creating a
Line
withsegment=False
(an infinite length line) and asking for its start and end points: