.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples\cross.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_cross.py: Cross Product Example ====================================== Compute the cross product of two vectors. .. GENERATED FROM PYTHON SOURCE LINES 7-24 .. rst-class:: sphx-glr-script-out .. code-block:: none Input vectors: u = [1. 0. 0.] v = [0. 1. 0.] Cross product u × v: [0. 0. 1.] | .. code-block:: Python import numpy as np from spheresmooth import cross # Example vectors u = np.array([1.0, 0.0, 0.0]) # (1, 0, 0) v = np.array([0.0, 1.0, 0.0]) # (0, 1, 0) print("Input vectors:") print("u =", u) print("v =", v) # Compute cross product (u × v) uv_cross = cross(u, v) print("\nCross product u × v:") print(uv_cross) .. _sphx_glr_download_auto_examples_cross.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: cross.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: cross.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: cross.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_