From: Michael Orlitzky Date: Tue, 25 Oct 2011 21:26:14 +0000 (-0400) Subject: Inline the dot product (Ben Lippmeier). X-Git-Tag: 0.0.1~81 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=922f93eb2aa9d8ef1747289f5973de25bd346edc;p=spline3.git Inline the dot product (Ben Lippmeier). --- diff --git a/src/Point.hs b/src/Point.hs index 49ad534..685bc7a 100644 --- a/src/Point.hs +++ b/src/Point.hs @@ -27,6 +27,7 @@ scale (x, y, z) d = (x*d, y*d, z*d) -- | Returns the dot product of two points (taken as three-vectors). +{-# INLINE dot #-} dot :: Point -> Point -> Double dot (x1, y1, z1) (x2, y2, z2) = (x2 - x1)^(2::Int) + (y2 - y1)^(2::Int) + (z2 - z1)^(2::Int)