Add more sounds

This commit is contained in:
2022-06-23 21:23:45 +01:00
parent 8d266a6770
commit fb3f677957
17 changed files with 291 additions and 228 deletions
+4 -2
View File
@@ -4,6 +4,7 @@ module Geometry.Vector3D
import Geometry.Vector
import Geometry.Data
import qualified Control.Foldl as L
import Data.List
infixl 6 +.+.+, -.-.-
@@ -27,7 +28,7 @@ V3 x1 y1 z1 -.-.- V3 x2 y2 z2 =
!y = y1 - y2
!z = z1 - z2
in V3 x y z
{- | 3D scalar multiplication. -}
{- | 3D scalar multiplication. Strict. -}
(*.*.*) :: Float -> Point3 -> Point3
{-# INLINE (*.*.*) #-}
a *.*.* (V3 x2 y2 z2) =
@@ -112,7 +113,8 @@ orderAround3 v ps = sortOn (argV . prj) ps
prj p = V2 (dotV3 xdir p) (dotV3 ydir p)
vCen3 :: [Point3] -> Point3
vCen3 ps = (1 / fromIntegral (length ps)) *.*.* foldr (+.+.+) (V3 0 0 0) ps
vCen3 = L.fold $ (/) <$> L.sum <*> L.genericLength
--vCen3 ps = (1 / fromIntegral (length ps)) *.*.* foldr (+.+.+) (V3 0 0 0) ps
dotV3 :: Point3 -> Point3 -> Float
dotV3 (V3 x y z) (V3 a b c) = x*a + y*b + z*c