X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FPoint.hs;h=fd3ac58dec3ceef5dfd5c8aa1615e25a9bc0af53;hb=e725cfe579b9d05ac040efc08f1ad47e5060de38;hp=49ad534385846b57e60875849a0edff87c39653f;hpb=610d0f0af8a802c26d51231d6e2426a72e40fd2d;p=spline3.git diff --git a/src/Point.hs b/src/Point.hs index 49ad534..fd3ac58 100644 --- a/src/Point.hs +++ b/src/Point.hs @@ -7,9 +7,6 @@ module Point ( ) where -import Comparisons ((~=)) - - type Point = (Double, Double, Double) instance Num Point where @@ -27,6 +24,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)