From dc48d4210ec264b0f833a8d2d8ebfefbdd50f8a7 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 2 Dec 2023 18:26:27 +0800 Subject: [PATCH] Update linalg.md --- docs/modules/linalg.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/modules/linalg.md b/docs/modules/linalg.md index 093d2e7f..9ded67a0 100644 --- a/docs/modules/linalg.md +++ b/docs/modules/linalg.md @@ -29,6 +29,16 @@ class vec2(_StructLike['vec2']): def rotate(self, radians: float) -> vec2: ... 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']): x: float y: float