-
Notifications
You must be signed in to change notification settings - Fork 677
Open
Labels
Description
Describe the bug
When Rotation3d.interpolate(Rotation3d, double) is called with t = 1, the output is nonsensical instead of being identical to the lerp endpoint rotation.
To Reproduce
var a = new Rotation3d(1,0,0);
var b = new Rotation3d(0,1,0);
var lerp = a.interpolate(b, 1);
System.out.println(a.toString());
System.out.println(b.toString());
System.out.println(lerp.toString());Expected console output:
Rotation3d(Quaternion(0.8775825618903728, 0.479425538604203, 0.0, 0.0))
Rotation3d(Quaternion(0.8775825618903728, 0.0, 0.479425538604203, 0.0))
Rotation3d(Quaternion(0.8775825618903728, 0.0, 0.479425538604203, 0.0))
Actual console output:
Rotation3d(Quaternion(0.8775825618903728, 0.479425538604203, 0.0, 0.0))
Rotation3d(Quaternion(0.8775825618903728, 0.0, 0.479425538604203, 0.0))
Rotation3d(Quaternion(0.8775825618903728, 1.1102230246251568E-16, 0.2590347239999257, -0.40342268011133486))
Quaternion visualization for b:

Quaternion visualization for lerp: (Should be identical to b but isn't)

Additional context
Originally discovered by truher on CD. Credit for the above visualizations go to them.