Find the intersection of two lines: Difference between revisions

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">defimport segment_intersection(a,pygame b,as c, d):pg
 
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
3

edits