vector module¶
This module contains the Vector3D class to be used for illustrating how to document and test a project.
A good example of the NumPy style can be found here: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html
-
class
vector.
Vector3D
(x, y, z)[source]¶ Bases:
object
A class for creating 3D vectors.
Parameters: Example
>>> u = Vector3D(1, 1, 1) >>> v = Vector3D(1, 2, 3) >>> w = u + v >>> print(w) (2, 3, 4)
-
cross
(other)[source]¶ Compute the cross product.
\[w = u \times v\]with
\[\begin{split}w_1 &= u_2 v_3 - u_3 v_2 \\ w_2 &= u_1 v_3 - u_3 v_1 \\ w_3 &= u_1 v_2 - u_2 v_1\end{split}\]Parameters: other (Vector3D) – Vector that you want to dot Returns: The dot product Return type: float
-
dot
(other)[source]¶ Compute the dot product.
\[u \cdot v = u_1v_1 + u_2v_2 + u_3v_3\]Parameters: other (Vector3D) – Vector that you want to dot. Returns: The dot product Return type: float
-
length
¶ Get length of vector (2-norm)
-