Skip to content

Class swarmauri_core.vectors.IVectorProduct.IVectorProduct

swarmauri_core.vectors.IVectorProduct.IVectorProduct

Bases: ABC

Interface for various vector products including dot product, cross product, and triple products (vector and scalar).

dot_product abstractmethod

dot_product(vector_a, vector_b)

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.

Source code in swarmauri_core/vectors/IVectorProduct.py
11
12
13
14
15
16
17
18
19
20
21
22
23
@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

cross_product abstractmethod

cross_product(vector_a, vector_b)

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.

Source code in swarmauri_core/vectors/IVectorProduct.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@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

vector_triple_product abstractmethod

vector_triple_product(vector_a, vector_b, vector_c)

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.

Source code in swarmauri_core/vectors/IVectorProduct.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@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

scalar_triple_product abstractmethod

scalar_triple_product(vector_a, vector_b, vector_c)

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.

Source code in swarmauri_core/vectors/IVectorProduct.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@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