MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / lerp

Function lerp

eval_code/recons/models/moge/utils3d/numpy/transforms.py:995–1007  ·  view source on GitHub ↗

Linear interpolation between two vectors. Args: x1 (np.ndarray): [..., d] vector 1 x2 (np.ndarray): [..., d] vector 2 t (np.ndarray): [...] interpolation parameter. [0, 1] for interpolation between x1 and x2, otherwise for extrapolation. Returns: np.nda

(x1: np.ndarray, x2: np.ndarray, t: np.ndarray)

Source from the content-addressed store, hash-verified

993
994
995def lerp(x1: np.ndarray, x2: np.ndarray, t: np.ndarray) -> np.ndarray:
996 """
997 Linear interpolation between two vectors.
998
999 Args:
1000 x1 (np.ndarray): [..., d] vector 1
1001 x2 (np.ndarray): [..., d] vector 2
1002 t (np.ndarray): [...] interpolation parameter. [0, 1] for interpolation between x1 and x2, otherwise for extrapolation.
1003
1004 Returns:
1005 np.ndarray: [..., d] interpolated vector
1006 """
1007 return x1 + np.asarray(t)[..., None] * (x2 - x1)
1008
1009
1010def lerp_se3_matrix(T1: np.ndarray, T2: np.ndarray, t: np.ndarray) -> np.ndarray:

Callers 2

lerp_se3_matrixFunction · 0.70
piecewise_lerpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected