Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12CF32F3A for ; Wed, 27 Apr 2011 11:59:46 +0000 (UTC) Received: (qmail 33553 invoked by uid 500); 27 Apr 2011 11:59:45 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 33373 invoked by uid 500); 27 Apr 2011 11:59:45 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 33365 invoked by uid 99); 27 Apr 2011 11:59:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2011 11:59:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2011 11:59:41 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 3763AB6E14 for ; Wed, 27 Apr 2011 11:59:03 +0000 (UTC) Date: Wed, 27 Apr 2011 11:59:03 +0000 (UTC) From: "Gilles (JIRA)" To: issues@commons.apache.org Message-ID: <482566395.5650.1303905543222.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <646037844.76223.1303465925730.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (MATH-561) Analogous to "normalizeAngle" in "MathUtils" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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