All compile errors fixed, but now there's a weird NaN. The wonders never cease
This commit is contained in:
@@ -15,7 +15,8 @@ rmsSize' :: Floating a => V2 a -> [V2 a] -> a
|
||||
rmsSize' centroid = sqrt . uncurry (/) . foldl1' (bimap2 (+) (+)) . map (quadrance . (^-^ centroid) &&& (const 1))
|
||||
|
||||
rmsSize :: Floating a => [V2 a] -> a
|
||||
rmsSize = centroid >>= rmsSize'
|
||||
rmsSize [] = 1/0
|
||||
rmsSize points = rmsSize' (centroid points) points
|
||||
|
||||
centroid :: Fractional a => [V2 a] -> V2 a
|
||||
centroid = uncurry (^/) . foldl1' (bimap2 (^+^) (+)) . map (flip (,) 1)
|
||||
|
||||
Reference in New Issue
Block a user