From ec012e33da8d25cd7a040b80849a6f7bb05ab5a7 Mon Sep 17 00:00:00 2001 From: "SND\\wo80_cp" Date: Thu, 31 Jan 2013 22:51:50 +0000 Subject: [PATCH] Minor performance tweaks. git-svn-id: https://triangle.svn.codeplex.com/svn@71767 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5 --- Triangle.NET/Triangle/NewLocation.cs | 6 +++--- Triangle.NET/Triangle/Quality.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Triangle.NET/Triangle/NewLocation.cs b/Triangle.NET/Triangle/NewLocation.cs index c9376b2..9ffb8d0 100644 --- a/Triangle.NET/Triangle/NewLocation.cs +++ b/Triangle.NET/Triangle/NewLocation.cs @@ -3999,21 +3999,21 @@ namespace TriangleNet // The edge opposite the apex is longest. maxedge = apexlen; // Find the cosine of the angle at the apex. - maxangle = (orglen + destlen - apexlen) / (2 * Math.Sqrt(orglen) * Math.Sqrt(destlen)); + maxangle = (orglen + destlen - apexlen) / (2 * Math.Sqrt(orglen * destlen)); } else if (orglen > destlen) { // The edge opposite the origin is longest. maxedge = orglen; // Find the cosine of the angle at the origin. - maxangle = (apexlen + destlen - orglen) / (2 * Math.Sqrt(apexlen) * Math.Sqrt(destlen)); + maxangle = (apexlen + destlen - orglen) / (2 * Math.Sqrt(apexlen * destlen)); } else { // The edge opposite the destination is longest. maxedge = destlen; // Find the cosine of the angle at the destination. - maxangle = (apexlen + orglen - destlen) / (2 * Math.Sqrt(apexlen) * Math.Sqrt(orglen)); + maxangle = (apexlen + orglen - destlen) / (2 * Math.Sqrt(apexlen * orglen)); } diff --git a/Triangle.NET/Triangle/Quality.cs b/Triangle.NET/Triangle/Quality.cs index 6212a40..d47fa60 100644 --- a/Triangle.NET/Triangle/Quality.cs +++ b/Triangle.NET/Triangle/Quality.cs @@ -464,21 +464,21 @@ namespace TriangleNet // The edge opposite the apex is longest. // maxedge = apexlen; // Find the cosine of the angle at the apex. - maxangle = (orglen + destlen - apexlen) / (2 * Math.Sqrt(orglen) * Math.Sqrt(destlen)); + maxangle = (orglen + destlen - apexlen) / (2 * Math.Sqrt(orglen * destlen)); } else if (orglen > destlen) { // The edge opposite the origin is longest. // maxedge = orglen; // Find the cosine of the angle at the origin. - maxangle = (apexlen + destlen - orglen) / (2 * Math.Sqrt(apexlen) * Math.Sqrt(destlen)); + maxangle = (apexlen + destlen - orglen) / (2 * Math.Sqrt(apexlen * destlen)); } else { // The edge opposite the destination is longest. // maxedge = destlen; // Find the cosine of the angle at the destination. - maxangle = (apexlen + orglen - destlen) / (2 * Math.Sqrt(apexlen) * Math.Sqrt(orglen)); + maxangle = (apexlen + orglen - destlen) / (2 * Math.Sqrt(apexlen * orglen)); } // Check whether the angle is smaller than permitted.