Find the intersection of two lines: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 2,283:
{{libheader|Pygame}}
Find the intersection by importing the external [https://www.pygame.org/docs/ PyGame] library.
<syntaxhighlight lang="python">
def segment_intersection(a, b, c, d):
""" returns a pygame.Vector2 or None if there is no intersection """
ab, cd, ac = a - b, c - d, a - c
|