Using Sin-1 or inverse sin in python

前端 未结 3 1533
忘掉有多难
忘掉有多难 2021-01-22 09:24

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)         


        
3条回答
  •  心在旅途
    2021-01-22 09:42

    Looks like you're trying to find the angle of the triangle (700,300), (x,300), (x,y). You're making it much more complicated than it needs to be. the length of the hypotenuse is math.hypot((700-x),(300-y)) and the angle is math.atan2((700-x), (300-y)).

提交回复
热议问题