Maintainer | diagrams-discuss@googlegroups.com |
---|

Utility functions for diagrams in two-dimensional Cartesian space.

- unitX :: R2
- unitY :: R2
- unit_X :: R2
- unit_Y :: R2
- direction :: R2 -> CircleFrac
- width :: (Boundable a, V a ~ R2) => a -> Double
- height :: (Boundable a, V a ~ R2) => a -> Double
- size2D :: (Boundable a, V a ~ R2) => a -> (Double, Double)
- extentX :: (Boundable a, V a ~ R2) => a -> (Double, Double)
- extentY :: (Boundable a, V a ~ R2) => a -> (Double, Double)
- center2D :: (Boundable a, V a ~ R2) => a -> P2

# General two-dimensional utilities

direction :: R2 -> CircleFracSource

Compute the direction of a vector, measured counterclockwise from the positive x-axis as a fraction of a full turn. The zero vector is arbitrarily assigned the direction 0.

# Size and extent of diagrams in R2

size2D :: (Boundable a, V a ~ R2) => a -> (Double, Double)Source

Compute the width and height of a diagram.

extentX :: (Boundable a, V a ~ R2) => a -> (Double, Double)Source

Compute the absolute x-coordinate range of a diagram in R2, in the form (lo,hi).