Here is my code:
# point of intersection between opposite and hypotenuse x,y = pygame.mouse.get_pos() # using formula for length of line lenline1 = (x-x)
To find the angle between two lines, use the following relation:
cos(angle) = (l1 dot l2) / (|l1| |l2|)
That is,
dotproduct = l1x * l2x + l1y * l2y lenproduct = |l1| * |l2| angle = acos(dotproduct / lenproduct)
where l1x, l1y are the x,y components of the line l1.