from abc import ABC, abstractmethod
from typing import List, Tuple
[docs]
class IVectorProduct(ABC):
"""
Interface for various vector products including dot product, cross product,
and triple products (vector and scalar).
"""
[docs]
@abstractmethod
def dot_product(self, vector_a: List[float], vector_b: List[float]) -> float:
"""
Calculate the dot product of two vectors.
Parameters:
- vector_a (List[float]): The first vector.
- vector_b (List[float]): The second vector.
Returns:
- float: The dot product of the two vectors.
"""
pass
[docs]
@abstractmethod
def cross_product(self, vector_a: List[float], vector_b: List[float]) -> List[float]:
"""
Calculate the cross product of two vectors.
Parameters:
- vector_a (List[float]): The first vector.
- vector_b (List[float]): The second vector.
Returns:
- List[float]: The cross product as a new vector.
"""
pass
[docs]
@abstractmethod
def vector_triple_product(self, vector_a: List[float], vector_b: List[float], vector_c: List[float]) -> List[float]:
"""
Calculate the vector triple product of three vectors.
Parameters:
- vector_a (List[float]): The first vector.
- vector_b (List[float]): The second vector.
- vector_c (List[float]): The third vector.
Returns:
- List[float]: The result of the vector triple product as a new vector.
"""
pass
[docs]
@abstractmethod
def scalar_triple_product(self, vector_a: List[float], vector_b: List[float], vector_c: List[float]) -> float:
"""
Calculate the scalar triple product of three vectors.
Parameters:
- vector_a (List[float]): The first vector.
- vector_b (List[float]): The second vector.
- vector_c (List[float]): The third vector.
Returns:
- float: The scalar value result of the scalar triple product.
"""
pass