compute the projection of v1 to v2 Args: v1 (np.ndarray): vector to be projected v2 (np.ndarray): projection vector Returns: float: projection
(v1: np.ndarray, v2: np.ndarray)
| 19 | |
| 20 | |
| 21 | def project(v1: np.ndarray, v2: np.ndarray) -> float: |
| 22 | """compute the projection of v1 to v2 |
| 23 | |
| 24 | Args: |
| 25 | v1 (np.ndarray): vector to be projected |
| 26 | v2 (np.ndarray): projection vector |
| 27 | |
| 28 | Returns: |
| 29 | float: projection |
| 30 | """ |
| 31 | return np.dot(v1, v2) / np.linalg.norm(v2, 2) |
| 32 | |
| 33 | |
| 34 | def normalize(yaw: Union[float, np.ndarray]) -> Union[float, np.ndarray]: |
nothing calls this directly
no outgoing calls
no test coverage detected