-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix(ops): spatial translation on a 4-pos and a 3-vel
- Loading branch information
Showing
3 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Copyright (c) 2023 coordinax maintainers. All rights reserved.""" | ||
|
||
__all__ = ["spatial_component"] | ||
|
||
from typing import Any | ||
|
||
from plum import dispatch | ||
|
||
from .base import AbstractPos | ||
|
||
|
||
@dispatch.abstract | ||
def spatial_component(x: Any, /) -> Any: | ||
"""Return the spatial component of the vector.""" | ||
raise NotImplementedError | ||
|
||
|
||
@dispatch | ||
def spatial_component(x: AbstractPos, /) -> AbstractPos: | ||
"""Return the spatial component of the vector.""" | ||
return x |