Repository: ManimCommunity/manim

Issue:
Multiplication of e.g. DOWN by a scalar is a type error on unreleased main branch
## Description of bug / unexpected behavior
Multiplication of `DOWN` by a float is a type error on `main`

![image](https://github.com/ManimCommunity/manim/assets/52205/37cc592e-e257-4f50-8d46-754fd76978f2)

This is because `DOWN` is a `Vector3D` and on `main` this is a union type including a tuple type:

```python
Vector3D: TypeAlias = Point3D
Point3D: TypeAlias = Union[InternalPoint3D, tuple[float, float, float]]
```

whereas on `v0.18.0` it is a `Vector3`:

```python
Vector3: TypeAlias = npt.NDArray[PointDType]
```


## Expected behavior
Multiplication of `DOWN` by a float should not be a type error.



## System specifications
VSCode Insiders Version: 1.86.0-insider
Commit: 9621add46007f7a1ab37d1fce9bcdcecca62aeb0



Discussion:

Resolving patch:
diff --git a/manim/typing.py b/manim/typing.py
--- a/manim/typing.py
+++ b/manim/typing.py
@@ -21,7 +21,7 @@
 from __future__ import annotations
 
 from os import PathLike
-from typing import Callable, Literal, Union
+from typing import Callable, Union
 
 import numpy as np
 import numpy.typing as npt
@@ -319,7 +319,7 @@
 Vector types
 """
 
-Vector2D: TypeAlias = Point2D
+Vector2D: TypeAlias = npt.NDArray[PointDType]
 """``shape: (2,)``
 
 A 2-dimensional vector: ``[float, float]``.
@@ -332,7 +332,7 @@
     VMobjects!
 """
 
-Vector2D_Array: TypeAlias = Point2D_Array
+Vector2D_Array: TypeAlias = npt.NDArray[PointDType]
 """``shape: (M, 2)``
 
 An array of `Vector2D` objects: ``[[float, float], ...]``.
@@ -341,7 +341,7 @@
 parameter can handle being passed a `Vector3D_Array` instead.
 """
 
-Vector3D: TypeAlias = Point3D
+Vector3D: TypeAlias = npt.NDArray[PointDType]
 """``shape: (3,)``
 
 A 3-dimensional vector: ``[float, float, float]``.
@@ -351,13 +351,13 @@
     VMobjects!
 """
 
-Vector3D_Array: TypeAlias = Point3D_Array
+Vector3D_Array: TypeAlias = npt.NDArray[PointDType]
 """``shape: (M, 3)``
 
 An array of `Vector3D` objects: ``[[float, float, float], ...]``.
 """
 
-VectorND: TypeAlias = Union[npt.NDArray[PointDType], tuple[float, ...]]
+VectorND: TypeAlias = npt.NDArray[PointDType]
 """``shape (N,)``
 
 An :math:`N`-dimensional vector: ``[float, ...]``.
@@ -368,19 +368,19 @@
     collisions.
 """
 
-VectorND_Array: TypeAlias = Union[npt.NDArray[PointDType], tuple[VectorND, ...]]
+VectorND_Array: TypeAlias = npt.NDArray[PointDType]
 """``shape (M, N)``
 
 An array of `VectorND` objects: ``[[float, ...], ...]``.
 """
 
-RowVector: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float, ...]]]
+RowVector: TypeAlias = npt.NDArray[PointDType]
 """``shape: (1, N)``
 
 A row vector: ``[[float, ...]]``.
 """
 
-ColVector: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float], ...]]
+ColVector: TypeAlias = npt.NDArray[PointDType]
 """``shape: (N, 1)``
 
 A column vector: ``[[float], [float], ...]``.
@@ -392,13 +392,13 @@
 Matrix types
 """
 
-MatrixMN: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[float, ...], ...]]
+MatrixMN: TypeAlias = npt.NDArray[PointDType]
 """``shape: (M, N)``
 
 A matrix: ``[[float, ...], [float, ...], ...]``.
 """
 
-Zeros: TypeAlias = Union[npt.NDArray[PointDType], tuple[tuple[Literal[0], ...], ...]]
+Zeros: TypeAlias = MatrixMN
 """``shape: (M, N)``
 
 A `MatrixMN` filled with zeros, typically created with


Test patch: