Source code for swarmauri.core.vectors.IVectorTransform
from abc import ABC, abstractmethod
from .IVector import IVector
[docs]
class IVectorTransform(ABC):
"""
Interface for performing various transformations on vectors.
"""
[docs]
@abstractmethod
def translate(self, translation_vector: IVector) -> IVector:
"""
Translate a vector by a given translation vector.
"""
pass
[docs]
@abstractmethod
def rotate(self, angle: float, axis: IVector) -> IVector:
"""
Rotate a vector around a given axis by a certain angle.
"""
pass
[docs]
@abstractmethod
def reflect(self, plane_normal: IVector) -> IVector:
"""
Reflect a vector across a plane defined by its normal vector.
"""
pass
[docs]
@abstractmethod
def scale(self, scale_factor: float) -> IVector:
"""
Scale a vector by a given scale factor.
"""
pass
[docs]
@abstractmethod
def shear(self, shear_factor: float, direction: IVector) -> IVector:
"""
Shear a vector along a given direction by a shear factor.
"""
pass
[docs]
@abstractmethod
def project(self, plane_normal: IVector) -> IVector:
"""
Project a vector onto a plane defined by its normal vector.
"""
pass