linear 1.6 → 1.7
raw patch · 4 files changed
+9/−4 lines, 4 files
Files
- CHANGELOG.markdown +5/−0
- linear.cabal +1/−1
- src/Linear/Quaternion.hs +1/−1
- src/Linear/Vector.hs +2/−2
CHANGELOG.markdown view
@@ -1,3 +1,8 @@+1.7+---+* Fixed `axisAngle`+* `unit` now has a rank 1 type.+ 1.5 --- * `lens` 4 compatibility
linear.cabal view
@@ -1,6 +1,6 @@ name: linear category: Math, Algebra-version: 1.6+version: 1.7 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE
src/Linear/Quaternion.hs view
@@ -490,6 +490,6 @@ -- | @'axisAngle' axis theta@ builds a 'Quaternion' representing a -- rotation of @theta@ radians about @axis@. axisAngle :: (Epsilon a, Floating a) => V3 a -> a -> Quaternion a-axisAngle axis theta = normalize $ Quaternion (cos half) $ sin half *^ axis+axisAngle axis theta = Quaternion (cos half) (sin half *^ normalize axis) where half = theta / 2 {-# INLINE axisAngle #-}
src/Linear/Vector.hs view
@@ -392,8 +392,8 @@ -- -- >>> unit _x :: V2 Int -- V2 1 0-unit :: (Applicative t, Num a) => Lens' (t a) a -> t a-unit l = runIdentity $ l (Identity . const 1) $ pure 0+unit :: (Applicative t, Num a) => ASetter' (t a) a -> t a+unit l = set' l 1 (pure 0) fillFromList :: Traversable t => [a] -> t b -> t a fillFromList l = snd . mapAccumL aux l