You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns None if the two vectors are almost collinear and with opposite direction
/// (in this case, there is an infinity of possible results).
This is only true for the 3D slerp, for 2D slerp there are only two possibilities. In either case, it might be more useful to return some result, rather than None. At the moment, the non-try variant will just return the original rotation which is quite surprising. IMO it would be better to return any rotation which is a valid solution rather than the original input.
You could have a slerp variation which returns Result<Rotation, RotationSet> where RotationSet would be a pair of rotations in 2D, and an implicitly defined "circle" of rotations in 3D, from which the user could pull out a single rotation by specifying a preferred solution in some way. The normal "slerp" function could call this function and then use an arbitrary method of selection.
Colinear, very close
At the moment, there is a special case for when they are exactly aligned, but there's no special case for when they are just very close - the Wikipedia article on SLERP suggests falling back to linear interpolation when the inputs are very close together. Do you think this is worthwhile?
The text was updated successfully, but these errors were encountered:
Colinear, opposite direction inputs
This is only true for the 3D slerp, for 2D slerp there are only two possibilities. In either case, it might be more useful to return some result, rather than
None
. At the moment, the non-try variant will just return the original rotation which is quite surprising. IMO it would be better to return any rotation which is a valid solution rather than the original input.You could have a slerp variation which returns
Result<Rotation, RotationSet>
whereRotationSet
would be a pair of rotations in 2D, and an implicitly defined "circle" of rotations in 3D, from which the user could pull out a single rotation by specifying a preferred solution in some way. The normal "slerp" function could call this function and then use an arbitrary method of selection.Colinear, very close
At the moment, there is a special case for when they are exactly aligned, but there's no special case for when they are just very close - the Wikipedia article on SLERP suggests falling back to linear interpolation when the inputs are very close together. Do you think this is worthwhile?
The text was updated successfully, but these errors were encountered: