Fix angle
This commit is contained in:
@@ -73,11 +73,11 @@ def _angle(v: tuple[float, float]) -> float:
|
|||||||
if v[0] >= 0 and v[1] >= 0:
|
if v[0] >= 0 and v[1] >= 0:
|
||||||
return math.asin(v[1])
|
return math.asin(v[1])
|
||||||
elif v[0] <= 0 and v[1] >= 0:
|
elif v[0] <= 0 and v[1] >= 0:
|
||||||
return math.asin(v[1]) + math.pi * 0.5
|
return math.pi - math.asin(v[1])
|
||||||
elif v[0] <= 0 and v[1] <= 0:
|
elif v[0] <= 0 and v[1] <= 0:
|
||||||
return math.asin(-v[1]) + math.pi
|
return math.asin(-v[1]) + math.pi
|
||||||
elif v[0] >= 0 and v[1] <= 0:
|
elif v[0] >= 0 and v[1] <= 0:
|
||||||
return math.asin(-v[1]) + math.pi * 1.5
|
return math.pi * 2 - math.asin(-v[1])
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user