Module: tfg.math.interpolation.slerp
Stay organized with collections
Save and categorize content based on your preferences.
Tensorflow.graphics slerp interpolation module.
Spherical linear interpolation (slerp) is defined for both quaternions and for
regular M-D vectors, and act slightly differently because of inherent
ambiguity of quaternions. This module has two functions returning the
interpolation weights for quaternions (quaternion_weights) and for vectors
(vector_weights), which can then be used in a weighted sum to calculate the
final interpolated quaternions and vectors. A helper interpolate function is
also provided.
The main differences between two methods are:
vector_weights:
can get any M-D tensor as input,
does not expect normalized vectors as input,
returns unnormalized outputs (in general) for unnormalized inputs.
quaternion_weights:
expects M-D tensors with a last dimension of 4,
assumes normalized input,
checks for ambiguity by looking at the angle between quaternions,
returns normalized quaternions naturally.
Classes
class InterpolationType
: Defines interpolation methods for slerp module.
Functions
interpolate(...)
: Applies slerp to vectors or quaternions.
interpolate_with_weights(...)
: Interpolates vectors by taking their weighted sum.
quaternion_weights(...)
: Calculates slerp weights for two normalized quaternions.
vector_weights(...)
: Spherical linear interpolation (slerp) between two unnormalized vectors.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-09-11 UTC."],[],[],null,["# Module: tfg.math.interpolation.slerp\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/math/interpolation/slerp.py) |\n\nTensorflow.graphics slerp interpolation module.\n\nSpherical linear interpolation (slerp) is defined for both quaternions and for\nregular M-D vectors, and act slightly differently because of inherent\nambiguity of quaternions. This module has two functions returning the\ninterpolation weights for quaternions (quaternion_weights) and for vectors\n(vector_weights), which can then be used in a weighted sum to calculate the\nfinal interpolated quaternions and vectors. A helper interpolate function is\nalso provided.\n\nThe main differences between two methods are:\nvector_weights:\ncan get any M-D tensor as input,\ndoes not expect normalized vectors as input,\nreturns unnormalized outputs (in general) for unnormalized inputs.\n\nquaternion_weights:\nexpects M-D tensors with a last dimension of 4,\nassumes normalized input,\nchecks for ambiguity by looking at the angle between quaternions,\nreturns normalized quaternions naturally.\n\nClasses\n-------\n\n[`class InterpolationType`](../../../tfg/math/interpolation/slerp/InterpolationType): Defines interpolation methods for slerp module.\n\nFunctions\n---------\n\n[`interpolate(...)`](../../../tfg/math/interpolation/slerp/interpolate): Applies slerp to vectors or quaternions.\n\n[`interpolate_with_weights(...)`](../../../tfg/math/interpolation/slerp/interpolate_with_weights): Interpolates vectors by taking their weighted sum.\n\n[`quaternion_weights(...)`](../../../tfg/math/interpolation/slerp/quaternion_weights): Calculates slerp weights for two normalized quaternions.\n\n[`vector_weights(...)`](../../../tfg/math/interpolation/slerp/vector_weights): Spherical linear interpolation (slerp) between two unnormalized vectors."]]