# tfg.math.interpolation.slerp.interpolate

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/math/interpolation/slerp.py#L70-L113) |

Applies slerp to vectors or quaternions.

    tfg.math.interpolation.slerp.interpolate(
        vector1: type_alias.TensorLike,
        vector2: type_alias.TensorLike,
        percent: type_alias.Float,
        method: https://www.tensorflow.org/graphics/api_docs/python/tfg/math/interpolation/slerp/InterpolationType = https://www.tensorflow.org/graphics/api_docs/python/tfg/math/interpolation/slerp/InterpolationType#QUATERNION,
        eps: Optional[type_alias.Float] = None,
        name: Optional[str] = None
    ) -> tf.Tensor

<br />

<br />

<br />

| ## Args ||
|---|---|
| `vector1` | A tensor of shape `[A1, ... , An, M]`, which stores a normalized vector in its last dimension. |
| `vector2` | A tensor of shape `[A1, ... , An, M]`, which stores a normalized vector in its last dimension. |
| `percent` | A `float` or a tensor with shape broadcastable to the shape of input vectors. |
| `method` | An enumerated constant from the class InterpolationType, which is either InterpolationType.QUATERNION (default) if the input vectors are 4-D quaternions, or InterpolationType.VECTOR if they are regular M-D vectors. |
| `eps` | A small float for operation safety. If left None, its value is automatically selected using dtype of input vectors. |
| `name` | A name for this op. Defaults to "vector_weights" or "quaternion_weights" depending on the method. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of shape \[A1, ... , An, M\]\` which stores the result of the interpolation. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if method is not amongst enumerated constants defined in InterpolationType. |

<br />