Copyright | (c) 2011 diagrams-lib team (see LICENSE) |
---|---|

License | BSD-style (see LICENSE) |

Maintainer | diagrams-discuss@googlegroups.com |

Safe Haskell | None |

Language | Haskell2010 |

Two-dimensional vectors.

- unitX :: (R1 v, Additive v, Num n) => v n
- unitY :: (R2 v, Additive v, Num n) => v n
- unit_X :: (R1 v, Additive v, Num n) => v n
- unit_Y :: (R2 v, Additive v, Num n) => v n
- xDir :: (R1 v, Additive v, Num n) => Direction v n
- yDir :: (R2 v, Additive v, Num n) => Direction v n
- angleV :: Floating n => Angle n -> V2 n
- angleDir :: Floating n => Angle n -> Direction V2 n
- e :: Floating n => Angle n -> V2 n
- signedAngleBetween :: RealFloat n => V2 n -> V2 n -> Angle n
- signedAngleBetweenDirs :: RealFloat n => Direction V2 n -> Direction V2 n -> Angle n
- perp :: Num a => V2 a -> V2 a
- leftTurn :: (Num n, Ord n) => V2 n -> V2 n -> Bool
- cross2 :: Num n => V2 n -> V2 n -> n

# Special 2D vectors

# Converting between vectors and angles

angleV :: Floating n => Angle n -> V2 n Source #

A unit vector at a specified angle counter-clockwise from the positive x-axis

angleDir :: Floating n => Angle n -> Direction V2 n Source #

A direction at a specified angle counter-clockwise from the `xDir`

.

e :: Floating n => Angle n -> V2 n Source #

A unit vector at a specified angle counter-clockwise from the positive X axis.

signedAngleBetween :: RealFloat n => V2 n -> V2 n -> Angle n Source #

Signed angle between two vectors. Currently defined as

signedAngleBetween u v = (u ^. _theta) ^-^ (v ^. _theta)

signedAngleBetweenDirs :: RealFloat n => Direction V2 n -> Direction V2 n -> Angle n Source #

Same as `signedAngleBetween`

but for `Directions`

s.

# 2D vector utilities

perp :: Num a => V2 a -> V2 a #

the counter-clockwise perpendicular vector

`>>>`

V2 (-20) 10`perp $ V2 10 20`