Note
Go to the end to download the full example code.
Cross Product Example#
Compute the cross product of two vectors.
Input vectors:
u = [1. 0. 0.]
v = [0. 1. 0.]
Cross product u × v:
[0. 0. 1.]
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)