Update linalg.md

This commit is contained in:
blueloveTH 2023-12-02 18:26:27 +08:00
parent e99e5ff768
commit dc48d4210e

View File

@ -29,6 +29,16 @@ class vec2(_StructLike['vec2']):
def rotate(self, radians: float) -> vec2: ... def rotate(self, radians: float) -> vec2: ...
def rotate_(self, radians: float) -> None: ... def rotate_(self, radians: float) -> None: ...
@staticmethod
def angle(__from: vec2, __to: vec2) -> float:
"""Returns the angle in radians between vectors `from` and `to`.
The result range is `[-pi, pi]`.
+ if y axis is top to bottom, positive value means clockwise
+ if y axis is bottom to top, positive value means counter-clockwise
"""
class vec3(_StructLike['vec3']): class vec3(_StructLike['vec3']):
x: float x: float
y: float y: float