commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (MATH-561) Analogous to "normalizeAngle" in "MathUtils"
Date Wed, 27 Apr 2011 11:59:03 GMT

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

Gilles resolved MATH-561.
-------------------------

    Resolution: Fixed

Revision 1097088.
[The image interval is actually [0, period); not [offset, period+offset), as first proposed.]


> Analogous to "normalizeAngle" in "MathUtils"
> --------------------------------------------
>
>                 Key: MATH-561
>                 URL: https://issues.apache.org/jira/browse/MATH-561
>             Project: Commons Math
>          Issue Type: Wish
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>             Fix For: 3.0
>
>
> I'd like to create a "reduce" method in "MathUtils", similar to "normalizeAngle" but
more general:
> {code}
> /**
>  * Reduce to the primary interval {@code [offset offset+period)}.
>  *
>  * @param a Value to reduce.
>  * @param period Period.
>  * @param offset Offset.
>  */
> public static double reduce(double a,
>                             double period,
>                             double offset) {
>     return a - period * FastMath.floor((a - offset) / period);
> }
> {code}
> Thus the "period" parameter the is not fixed to 2&pi;, as is the case in "normalizeAngle".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message