plots-0.1.0.2: Diagrams based plotting library.

Copyright(C) 2015 Christopher Chalmers
LicenseBSD-style (see the file LICENSE)
MaintainerChristopher Chalmers
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Diagrams.Coordinates.Polar

Contents

Description

This module defines a polar coordinate data type. This type can be used as an axis space for polar plots.

Synopsis

Polar type

newtype Polar a Source #

Constructors

Polar (V2 a) 

Instances

Monad Polar Source # 

Methods

(>>=) :: Polar a -> (a -> Polar b) -> Polar b #

(>>) :: Polar a -> Polar b -> Polar b #

return :: a -> Polar a #

fail :: String -> Polar a #

Functor Polar Source # 

Methods

fmap :: (a -> b) -> Polar a -> Polar b #

(<$) :: a -> Polar b -> Polar a #

MonadFix Polar Source # 

Methods

mfix :: (a -> Polar a) -> Polar a #

Applicative Polar Source # 

Methods

pure :: a -> Polar a #

(<*>) :: Polar (a -> b) -> Polar a -> Polar b #

(*>) :: Polar a -> Polar b -> Polar b #

(<*) :: Polar a -> Polar b -> Polar a #

Foldable Polar Source # 

Methods

fold :: Monoid m => Polar m -> m #

foldMap :: Monoid m => (a -> m) -> Polar a -> m #

foldr :: (a -> b -> b) -> b -> Polar a -> b #

foldr' :: (a -> b -> b) -> b -> Polar a -> b #

foldl :: (b -> a -> b) -> b -> Polar a -> b #

foldl' :: (b -> a -> b) -> b -> Polar a -> b #

foldr1 :: (a -> a -> a) -> Polar a -> a #

foldl1 :: (a -> a -> a) -> Polar a -> a #

toList :: Polar a -> [a] #

null :: Polar a -> Bool #

length :: Polar a -> Int #

elem :: Eq a => a -> Polar a -> Bool #

maximum :: Ord a => Polar a -> a #

minimum :: Ord a => Polar a -> a #

sum :: Num a => Polar a -> a #

product :: Num a => Polar a -> a #

Traversable Polar Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Polar a -> f (Polar b) #

sequenceA :: Applicative f => Polar (f a) -> f (Polar a) #

mapM :: Monad m => (a -> m b) -> Polar a -> m (Polar b) #

sequence :: Monad m => Polar (m a) -> m (Polar a) #

Generic1 Polar Source # 

Associated Types

type Rep1 (Polar :: * -> *) :: * -> * #

Methods

from1 :: Polar a -> Rep1 Polar a #

to1 :: Rep1 Polar a -> Polar a #

Distributive Polar Source # 

Methods

distribute :: Functor f => f (Polar a) -> Polar (f a) #

collect :: Functor f => (a -> Polar b) -> f a -> Polar (f b) #

distributeM :: Monad m => m (Polar a) -> Polar (m a) #

collectM :: Monad m => (a -> Polar b) -> m a -> Polar (m b) #

Representable Polar Source # 

Associated Types

type Rep (Polar :: * -> *) :: * #

Methods

tabulate :: (Rep Polar -> a) -> Polar a #

index :: Polar a -> Rep Polar -> a #

MonadZip Polar Source # 

Methods

mzip :: Polar a -> Polar b -> Polar (a, b) #

mzipWith :: (a -> b -> c) -> Polar a -> Polar b -> Polar c #

munzip :: Polar (a, b) -> (Polar a, Polar b) #

HasR Polar Source # 

Methods

_r :: RealFloat n => Lens' (Polar n) n #

HasY Polar Source # 

Methods

y_ :: RealFloat n => Lens' (Polar n) n Source #

xy_ :: RealFloat n => Lens' (Polar n) (V2 n) Source #

HasX Polar Source # 

Methods

x_ :: RealFloat n => Lens' (Polar n) n Source #

Circle Polar Source # 

Methods

_azimuth :: Functor f => (Angle a -> f (Angle a)) -> Polar a -> f (Polar a) Source #

_polar :: Functor f => (Polar a -> f (Polar a)) -> Polar a -> f (Polar a) Source #

Radial Polar Source # 

Methods

_radial :: Functor f => (a -> f a) -> Polar a -> f (Polar a) Source #

(TypeableFloat n, Renderable (Path V2 n) b) => RenderAxis b Polar n Source # 
RealFloat n => PointLike V2 n (Polar n) Source #

Does not satify lens laws.

Wrapped (Polar a0) Source # 

Associated Types

type Unwrapped (Polar a0) :: * #

Methods

_Wrapped' :: Iso' (Polar a0) (Unwrapped (Polar a0)) #

(~) * (Polar a0) t0 => Rewrapped (Polar a1) t0 Source # 
type Rep1 Polar Source # 
type Rep1 Polar = D1 (MetaData "Polar" "Diagrams.Coordinates.Polar" "plots-0.1.0.2-GlEgg7pI4oCBOs6O650FMA" True) (C1 (MetaCons "Polar" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 V2)))
type Rep Polar Source # 
type Rep Polar = E Polar
type BaseSpace Polar Source # 
type Unwrapped (Polar a0) Source # 
type Unwrapped (Polar a0) = V2 a0
type MainOpts (Axis b Polar n) # 

mkPolar :: n -> Angle n -> Polar n Source #

Construct a Polar from a magnitude and an Angle.

polar :: (n, Angle n) -> Polar n Source #

Construct a Polar from a magnitude and Angle tuple.

unpolar :: Polar n -> (n, Angle n) Source #

Turn a Polar back into a magnitude and Angle tuple.

polarIso :: Iso' (Polar n) (n, Angle n) Source #

Iso' between Polar and its tuple form.

polarV2 :: RealFloat n => Iso' (Polar n) (V2 n) Source #

Numerical Iso' between Polar and R2.

Polar functions

interpPolar :: Num n => n -> Polar n -> Polar n -> Polar n Source #

Polar interpolation between two polar coordinates.

Classes

class Radial t where Source #

Space which has a radial length basis. For Polar and Cylindrical this is the radius of the circle in the xy-plane. For Spherical this is the distance from the origin.

Methods

_radial :: Lens' (t a) a Source #

Instances

Radial Polar Source # 

Methods

_radial :: Functor f => (a -> f a) -> Polar a -> f (Polar a) Source #

class Radial t => Circle t where Source #

Space which has a radial and angular basis.

Methods

_azimuth :: Lens' (t a) (Angle a) Source #

_polar :: Lens' (t a) (Polar a) Source #

Instances

Circle Polar Source # 

Methods

_azimuth :: Functor f => (Angle a -> f (Angle a)) -> Polar a -> f (Polar a) Source #

_polar :: Functor f => (Polar a -> f (Polar a)) -> Polar a -> f (Polar a) Source #

class HasX t where Source #

Coordinate with at least one dimension where the x coordinate can be retreived numerically. Note this differs slightly from R1 which requires a lens for all values. This allows instances for different coordinates such as Polar, where the x coordinate can only be retreived numerically.

Minimal complete definition

x_

Methods

x_ :: RealFloat n => Lens' (t n) n Source #

Instances

HasX V2 Source # 

Methods

x_ :: RealFloat n => Lens' (V2 n) n Source #

HasX V3 Source # 

Methods

x_ :: RealFloat n => Lens' (V3 n) n Source #

HasX Polar Source # 

Methods

x_ :: RealFloat n => Lens' (Polar n) n Source #

HasX v => HasX (Point v) Source # 

Methods

x_ :: RealFloat n => Lens' (Point v n) n Source #

class HasX t => HasY t where Source #

Coordinate with at least two dimensions where the x and y coordinates can be retreived numerically.

Minimal complete definition

xy_

Methods

y_ :: RealFloat n => Lens' (t n) n Source #

xy_ :: RealFloat n => Lens' (t n) (V2 n) Source #

Instances

HasY V2 Source # 

Methods

y_ :: RealFloat n => Lens' (V2 n) n Source #

xy_ :: RealFloat n => Lens' (V2 n) (V2 n) Source #

HasY V3 Source # 

Methods

y_ :: RealFloat n => Lens' (V3 n) n Source #

xy_ :: RealFloat n => Lens' (V3 n) (V2 n) Source #

HasY Polar Source # 

Methods

y_ :: RealFloat n => Lens' (Polar n) n Source #

xy_ :: RealFloat n => Lens' (Polar n) (V2 n) Source #

HasY v => HasY (Point v) Source # 

Methods

y_ :: RealFloat n => Lens' (Point v n) n Source #

xy_ :: RealFloat n => Lens' (Point v n) (V2 n) Source #

class HasR t where #

A space which has magnitude _r that can be calculated numerically.

Minimal complete definition

Nothing

Instances

HasR V2 

Methods

_r :: RealFloat n => Lens' (V2 n) n #

HasR Polar # 

Methods

_r :: RealFloat n => Lens' (Polar n) n #

HasR v => HasR (Point v) 

Methods

_r :: RealFloat n => Lens' (Point v n) n #

Basis elements

er :: Radial v => E v Source #

:: Circle v => E v Source #

etheta :: Circle v => E v Source #