jax.scipy.spatial.transform.Slerp#
- class jax.scipy.spatial.transform.Slerp(times, timedelta, rotations, rotvecs)[原始碼]#
旋轉的球面線性插值。
scipy.spatial.transform.Slerp
的 JAX 實作。範例
從一系列旋轉建立 Slerp 實例
>>> import math >>> from jax.scipy.spatial.transform import Rotation, Slerp >>> rots = jnp.array([[90, 0, 0], ... [0, 45, 0], ... [0, 0, -30]]) >>> key_rotations = Rotation.from_euler('zxy', rots, degrees=True) >>> key_times = [0, 1, 2] >>> slerp = Slerp.init(key_times, key_rotations) >>> times = [0, 0.5, 1, 1.5, 2] >>> interp_rots = slerp(times) >>> interp_rots.as_euler('zxy') Array([[ 1.5707963e+00, 0.0000000e+00, 0.0000000e+00], [ 8.5309029e-01, 3.8711953e-01, 1.7768645e-01], [-2.3841858e-07, 7.8539824e-01, 0.0000000e+00], [-5.6668043e-02, 3.9213133e-01, -2.8347540e-01], [ 0.0000000e+00, 0.0000000e+00, -5.2359891e-01]], dtype=float32)
- 參數:
times (jnp.ndarray)
timedelta (jnp.ndarray)
rotations (Rotation)
rotvecs (jnp.ndarray)
- __init__()#
方法
__init__
()count
(value, /)傳回 value 出現的次數。
index
(value[, start, stop])傳回 value 首次出現的索引。
init
(times, rotations)屬性
rotations
欄位編號 2 的別名
rotvecs
欄位編號 3 的別名
timedelta
欄位編號 1 的別名
times
欄位編號 0 的別名