.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples\spherical_dist.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_spherical_dist.py: Spherical Distance Example ========================== Compute the spherical distance between two vectors on the unit sphere. .. GENERATED FROM PYTHON SOURCE LINES 7-24 .. rst-class:: sphx-glr-script-out .. code-block:: none Input vectors: x = [1. 0. 0.] y = [0. 1. 0.] Spherical distance spherical_dist(x, y): 1.5707963267948966 | .. code-block:: Python import numpy as np from spheresmooth import spherical_dist # Example vectors x = np.array([1.0, 0.0, 0.0]) y = np.array([0.0, 1.0, 0.0]) print("Input vectors:") print("x =", x) print("y =", y) # Compute spherical distance dist = spherical_dist(x, y) print("\nSpherical distance spherical_dist(x, y):") print(dist) .. _sphx_glr_download_auto_examples_spherical_dist.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: spherical_dist.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: spherical_dist.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: spherical_dist.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_