[
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π, 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