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 3739718233 for ; Mon, 6 Jul 2015 12:07:05 +0000 (UTC) Received: (qmail 9554 invoked by uid 500); 6 Jul 2015 12:07:05 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 9455 invoked by uid 500); 6 Jul 2015 12:07:04 -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 9434 invoked by uid 99); 6 Jul 2015 12:07:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2015 12:07:04 +0000 Date: Mon, 6 Jul 2015 12:07:04 +0000 (UTC) From: "Gilles (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (MATH-1244) Add "cosAngle" method in "MathArrays" 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-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gilles resolved MATH-1244. -------------------------- Resolution: Fixed Fix Version/s: (was: 3.6) commit ed6c47dd9ebbb2e38fb3e17a2b961f0fcf0e6df3 > Add "cosAngle" method in "MathArrays" > ------------------------------------- > > Key: MATH-1244 > URL: https://issues.apache.org/jira/browse/MATH-1244 > Project: Commons Math > Issue Type: New Feature > Reporter: Gilles > Assignee: Gilles > Priority: Trivial > Fix For: 4.0 > > > Similar to other utilities (e.g. "distance") that interprets a Java array as Cartesian coordinates, I propose to add the function that calculates the cosine of the angle between two vectors: > {code} > public static double cosAngle(double[] v1, double[] v2) { > return linearCombination(v1, v2) / (safeNorm(v1) * safeNorm(v2)); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)