This commit is contained in:
blueloveTH 2023-08-03 00:09:06 +08:00
parent 81f43ab09b
commit c4700e71ac
2 changed files with 25 additions and 3 deletions

View File

@ -3,10 +3,11 @@ icon: package
label: linalg label: linalg
--- ---
Provide `mat3x3`, `vec2` and `vec3` types. Provide `mat3x3`, `vec2`, `vec3` and `vec4` types.
```python ```python
from typing import overload from typing import overload
from c import float_p
class vec2: class vec2:
x: float x: float
@ -24,6 +25,7 @@ class vec2:
def length_squared(self) -> float: ... def length_squared(self) -> float: ...
def normalize(self) -> vec2: ... def normalize(self) -> vec2: ...
def rotate(self, radians: float) -> vec2: ... def rotate(self, radians: float) -> vec2: ...
def addr(self) -> float_p: ...
class vec3: class vec3:
x: float x: float
@ -41,6 +43,25 @@ class vec3:
def length(self) -> float: ... def length(self) -> float: ...
def length_squared(self) -> float: ... def length_squared(self) -> float: ...
def normalize(self) -> vec3: ... def normalize(self) -> vec3: ...
def addr(self) -> float_p: ...
class vec4:
x: float
y: float
z: float
w: float
def __init__(self, x: float, y: float, z: float, w: float) -> None: ...
def copy(self) -> vec4: ...
def __add__(self, other: vec4) -> vec4: ...
def __sub__(self, other: vec4) -> vec4: ...
def __mul__(self, other: float) -> vec4: ...
def __truediv__(self, other: float) -> vec4: ...
def dot(self, other: vec4) -> float: ...
def length(self) -> float: ...
def length_squared(self) -> float: ...
def normalize(self) -> vec4: ...
def addr(self) -> float_p: ...
class mat3x3: class mat3x3:
_11: float _11: float
@ -83,6 +104,8 @@ class mat3x3:
def transpose(self) -> mat3x3: ... def transpose(self) -> mat3x3: ...
def inverse(self) -> mat3x3: ... def inverse(self) -> mat3x3: ...
def __invert__(self) -> mat3x3: ...
@staticmethod @staticmethod
def zeros() -> mat3x3: ... def zeros() -> mat3x3: ...
@staticmethod @staticmethod
@ -95,8 +118,6 @@ class mat3x3:
def trs(t: vec2, r: float, s: vec2) -> mat3x3: ... def trs(t: vec2, r: float, s: vec2) -> mat3x3: ...
def is_affine(self) -> bool: ... def is_affine(self) -> bool: ...
def inverse_affine(self) -> mat3x3: ...
def matmul_affine(self, other: mat3x3) -> mat3x3: ...
def translation(self) -> vec2: ... def translation(self) -> vec2: ...
def rotation(self) -> float: ... def rotation(self) -> float: ...

View File

@ -10,6 +10,7 @@ fi
rm -rf .coverage rm -rf .coverage
mkdir .coverage mkdir .coverage
rm pocketpy_c.gcno
UNITS=$(find ./ -name "*.gcno") UNITS=$(find ./ -name "*.gcno")
llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt
mv *.gcov .coverage mv *.gcov .coverage