Matt Juntunen created GEOMETRY-90:
-------------------------------------
Summary: Slerp Wrapper
Key: GEOMETRY-90
URL: https://issues.apache.org/jira/browse/GEOMETRY-90
Project: Apache Commons Geometry
Issue Type: Improvement
Reporter: Matt Juntunen
The current API for performing slerp operations with {{QuaternionRotation}}
instances is somewhat cumbersome. The {{QuaternionRotation.slerp}} method
returns an instance of {{org.apache.commons.numbers.quaternion.Slerp}}, which
cannot be directly used with any of the other classes in commons-geometry. The
use cases therefore end up looking like this:
{code:java}
QuaterionRotation start = ...;
QuaternionRotation end = ...;
Slerp s = start.slerp(end);
Quaternion midQuat = s.apply(0.5); // commons-numbers objects
QuaterionRotation mid = QuaternionRotation.of(midQuat); // convert to
commons-geometry object
{code}
I propose that the {{QuaternionRotation.slerp}} method return a small wrapper
class (perhaps named {{SlerpFunction}} to avoid a name collision with
{{Slerp}}) that makes this more convenient.
{code:java}
QuaterionRotation start = ...;
QuaternionRotation end = ...;
SlerpFunction s = start.slerp(end);
QuaterionRotation mid = s.apply(0.5); // no conversions needed
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)