Work on crab feet
This commit is contained in:
@@ -67,6 +67,12 @@ angleVV a b
|
||||
d = a `dotV` b
|
||||
in acos $ d / (ma * mb)
|
||||
|
||||
-- returns the angle opposite length a
|
||||
angleThreeSides :: Float -> Float -> Float -> Float
|
||||
angleThreeSides a b c = acos $ (f b + f c - f a) / (2*b*c)
|
||||
where
|
||||
f = (^ (2 ::Int))
|
||||
|
||||
-- | Safe version of 'angleVV' that returns 0 if either vector is null.
|
||||
safeAngleVV :: Point2 -> Point2 -> Float
|
||||
{-# INLINE safeAngleVV #-}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
module Geometry.Vector3D
|
||||
where
|
||||
import Linear
|
||||
import Geometry.Vector
|
||||
import Geometry.Data
|
||||
|
||||
@@ -121,7 +122,7 @@ dotV3 (V3 x y z) (V3 a b c) = x*a + y*b + z*c
|
||||
|
||||
angleVV3 :: Point3 -> Point3 -> Float
|
||||
angleVV3 a b
|
||||
| a == b = 0
|
||||
| a == b || norm a == 0 || norm b == 0 = 0
|
||||
| otherwise = acos $ dotV3 a b / (magV3 a * magV3 b)
|
||||
|
||||
--projV3 :: Point3 -> Point3 -> Point3
|
||||
|
||||
Reference in New Issue
Block a user