def showName(self, context): """Show the name of the astre.""" c = Point(*(udd * self.position)) c.showText(context, self.name, size=10, color=self.color)
else: s1.color = mycolors.WHITE s2.color = mycolors.WHITE l1 = s1.getLine() l2 = s2.getLine() l1.color = mycolors.GREEN l1.width = 1 l2.color = mycolors.GREEN l2.width = 1 l1.show(surface) l2.show(surface) s1.show(surface) s2.show(surface) p1 = s1.center p1.show(surface, color=mycolors.RED) p.showText(surface, "p") p1.showText(surface, "p1") p2.showText(surface, "p2") p3.showText(surface, "p3") pl = l1.crossLine(l2) if pl: pl.show(surface, color=mycolors.RED, mode="cross", width=3) pl.showText(surface, "pl") print("in s1:", pl in s1) print("in s2:", pl in s2) v1 = Vector.createFromTwoPoints(s1.p1, pl) v1.color = mycolors.BLUE v2 = s1.getVector() v2.color = mycolors.YELLOW