def bulge2arc(self, Ps, Pe, bulge): """ bulge2arc() """ c = (1 / bulge - bulge) / 2 # Berechnung des Mittelpunkts (Formel von Mickes!) # Calculation of the center (Micke's formula) O = Point((Ps.x + Pe.x - (Pe.y - Ps.y) * c) / 2, (Ps.y + Pe.y + (Pe.x - Ps.x) * c) / 2) # Radius = Distance between the centre and Ps r = O.distance(Ps) # Kontrolle ob beide gleich sind (passt ...) # Check if they are equal (fits ...) # r=O.distance(Pe) # Unterscheidung f�r den �ffnungswinkel. # Distinction for the opening angle. ??? if bulge > 0: return ArcGeo(Ps=Ps, Pe=Pe, O=O, r=r) else: arc = ArcGeo(Ps=Pe, Pe=Ps, O=O, r=r) arc.reverse() return arc
def bulge2arc(self, Ps, Pe, bulge): """ bulge2arc() """ c = (1 / bulge - bulge) / 2 # Calculate the centre point (Micke's formula!) O = Point((Ps.x + Pe.x - (Pe.y - Ps.y) * c) / 2, (Ps.y + Pe.y + (Pe.x - Ps.x) * c) / 2) # Radius = Distance between the centre and Ps r = O.distance(Ps) # Check if they are equal (fits ...) # r=O.distance(Pe) # Unterscheidung f�r den �ffnungswinkel. # Distinction for the opening angle. ??? if bulge > 0: return ArcGeo(Ps=Ps, Pe=Pe, O=O, r=r) else: arc = ArcGeo(Ps=Pe, Pe=Ps, O=O, r=r) arc.reverse() return arc