Debian Codegraph @

src/Diagrams/ThreeD/Vector.hs

raw symbols SCIP
1 -----------------------------------------------------------------------------
2 -- |
3 -- Module : Diagrams.ThreeD.Vector
4 -- Copyright : (c) 2013 diagrams-lib team (see LICENSE)
5 -- License : BSD-style (see LICENSE)
6 -- Maintainer : [email protected]
7 --
8 -- Three-dimensional vectors.
9 --
10 -----------------------------------------------------------------------------
11 module Diagrams.ThreeD.Vector
12 ( -- * Special 3D vectors
13 unitX, unitY, unitZ, unit_X, unit_Y, unit_Z
14 , xDir, yDir, zDir
15 ) where
16
17 import Control.Lens ((&), (.~))
18
19 import Diagrams.ThreeD.Types
20 import Diagrams.TwoD.Vector
21 import Diagrams.Direction
22
23 import Linear.Vector
24
25 -- | The unit vector in the positive Y direction.
26 unitZ :: (R3 v, Additive v, Num n) => v n
27 unitZ = zero & _z .~ 1
28
29 -- | The unit vector in the negative X direction.
30 unit_Z :: (R3 v, Additive v, Num n) => v n
31 unit_Z = zero & _z .~ (-1)
32
33 -- | A 'Direction' pointing in the Z direction.
34 zDir :: (R3 v, Additive v, Num n) => Direction v n
35 zDir = dir unitZ