1
0

linalg.pyi 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. from typing import overload
  2. from c import float_p
  3. class vec2:
  4. x: float
  5. y: float
  6. def __init__(self, x: float, y: float) -> None: ...
  7. def copy(self) -> vec2: ...
  8. def __add__(self, other: vec2) -> vec2: ...
  9. def __sub__(self, other: vec2) -> vec2: ...
  10. def __mul__(self, other: float) -> vec2: ...
  11. def __truediv__(self, other: float) -> vec2: ...
  12. def dot(self, other: vec2) -> float: ...
  13. def cross(self, other: vec2) -> float: ...
  14. def length(self) -> float: ...
  15. def length_squared(self) -> float: ...
  16. def normalize(self) -> vec2: ...
  17. def rotate(self, radians: float) -> vec2: ...
  18. def addr(self) -> float_p: ...
  19. class vec3:
  20. x: float
  21. y: float
  22. z: float
  23. def __init__(self, x: float, y: float, z: float) -> None: ...
  24. def copy(self) -> vec3: ...
  25. def __add__(self, other: vec3) -> vec3: ...
  26. def __sub__(self, other: vec3) -> vec3: ...
  27. def __mul__(self, other: float) -> vec3: ...
  28. def __truediv__(self, other: float) -> vec3: ...
  29. def dot(self, other: vec3) -> float: ...
  30. def cross(self, other: vec3) -> float: ...
  31. def length(self) -> float: ...
  32. def length_squared(self) -> float: ...
  33. def normalize(self) -> vec3: ...
  34. def addr(self) -> float_p: ...
  35. class vec4:
  36. x: float
  37. y: float
  38. z: float
  39. w: float
  40. def __init__(self, x: float, y: float, z: float, w: float) -> None: ...
  41. def copy(self) -> vec4: ...
  42. def __add__(self, other: vec4) -> vec4: ...
  43. def __sub__(self, other: vec4) -> vec4: ...
  44. def __mul__(self, other: float) -> vec4: ...
  45. def __truediv__(self, other: float) -> vec4: ...
  46. def dot(self, other: vec4) -> float: ...
  47. def length(self) -> float: ...
  48. def length_squared(self) -> float: ...
  49. def normalize(self) -> vec4: ...
  50. def addr(self) -> float_p: ...
  51. class mat3x3:
  52. _11: float
  53. _12: float
  54. _13: float
  55. _21: float
  56. _22: float
  57. _23: float
  58. _31: float
  59. _32: float
  60. _33: float
  61. @overload
  62. def __init__(self) -> None: ...
  63. @overload
  64. def __init__(self, _11, _12, _13, _21, _22, _23, _31, _32, _33) -> None: ...
  65. @overload
  66. def __init__(self, a: list[list]): ...
  67. def set_zeros(self) -> None: ...
  68. def set_ones(self) -> None: ...
  69. def set_identity(self) -> None: ...
  70. def copy(self) -> mat3x3: ...
  71. def __getitem__(self, index: tuple[int, int]) -> float: ...
  72. def __setitem__(self, index: tuple[int, int], value: float) -> None: ...
  73. def __add__(self, other: mat3x3) -> mat3x3: ...
  74. def __sub__(self, other: mat3x3) -> mat3x3: ...
  75. def __mul__(self, other: float) -> mat3x3: ...
  76. def __truediv__(self, other: float) -> mat3x3: ...
  77. @overload
  78. def __matmul__(self, other: mat3x3) -> mat3x3: ...
  79. @overload
  80. def __matmul__(self, other: vec3) -> vec3: ...
  81. @overload
  82. def matmul(self, other: mat3x3) -> mat3x3: ...
  83. @overload
  84. def matmul(self, other: vec3) -> vec3: ...
  85. def determinant(self) -> float: ...
  86. def transpose(self) -> mat3x3: ...
  87. def inverse(self) -> mat3x3: ...
  88. def __invert__(self) -> mat3x3: ...
  89. @staticmethod
  90. def zeros() -> mat3x3: ...
  91. @staticmethod
  92. def ones() -> mat3x3: ...
  93. @staticmethod
  94. def identity() -> mat3x3: ...
  95. # affine transformations
  96. @staticmethod
  97. def trs(t: vec2, r: float, s: vec2) -> mat3x3: ...
  98. def is_affine(self) -> bool: ...
  99. def translation(self) -> vec2: ...
  100. def rotation(self) -> float: ...
  101. def scale(self) -> vec2: ...
  102. def transform_point(self, p: vec2) -> vec2: ...
  103. def transform_vector(self, v: vec2) -> vec2: ...