Note
Go to the end to download the full example code.
Geodesic Path Example#
Compute multiple points along the geodesic curve between two points on the unit sphere.
Inputs:
t = [0.25 0.5 0.75]
p = [1. 0. 0.]
q = [0. 1. 0.]
a = 0.0 , b = 1.0
Geodesic points at t = [0.25, 0.5, 0.75]:
[[0.92387953 0.38268343 0. ]
[0.70710678 0.70710678 0. ]
[0.38268343 0.92387953 0. ]]
import numpy as np
from spheresmooth import geodesic
# Example inputs
t = np.array([0.25, 0.5, 0.75])
p = np.array([1.0, 0.0, 0.0])
q = np.array([0.0, 1.0, 0.0])
a = 0.0
b = 1.0
print("Inputs:")
print("t =", t)
print("p =", p)
print("q =", q)
print("a =", a, ", b =", b)
# Compute the geodesic curve at multiple time points
gamma = geodesic(t, p, q, a, b)
print("\nGeodesic points at t = [0.25, 0.5, 0.75]:")
print(gamma)
Total running time of the script: (0 minutes 0.001 seconds)