You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Matt Juntunen (Jira)" <ji...@apache.org> on 2020/03/07 12:23:00 UTC

[jira] [Resolved] (GEOMETRY-90) Slerp Wrapper

     [ https://issues.apache.org/jira/browse/GEOMETRY-90?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Juntunen resolved GEOMETRY-90.
-----------------------------------
    Resolution: Done

> Slerp Wrapper
> -------------
>
>                 Key: GEOMETRY-90
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-90
>             Project: Apache Commons Geometry
>          Issue Type: Improvement
>            Reporter: Matt Juntunen
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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)