plots-0.1.1.4: Diagrams based plotting library
Copyright(C) 2015 Christopher Chalmers
LicenseBSD-style (see the file LICENSE)
MaintainerChristopher Chalmers
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Diagrams.Coordinates.Polar

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

Instances details
Representable Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Associated Types

type Rep Polar #

Methods

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

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

MonadFix Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

MonadZip Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

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) #

Foldable Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

foldMap :: Monoid m => (a -> m) -> Polar a -> 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 # 
Instance details

Defined in Diagrams.Coordinates.Polar

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) #

Applicative Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

pure :: a -> Polar a #

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

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

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

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

Functor Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

Monad Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

return :: a -> Polar a #

HasR Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

Distributive Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

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) #

Circle Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

HasX Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

HasY Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

Radial Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

Generic1 Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Associated Types

type Rep1 Polar :: k -> Type #

Methods

from1 :: forall (a :: k). Polar a -> Rep1 Polar a #

to1 :: forall (a :: k). Rep1 Polar a -> Polar a #

(TypeableFloat n, Renderable (Path V2 n) b) => RenderAxis b Polar n Source # 
Instance details

Defined in Plots.Axis.Render

RealFloat n => PointLike V2 n (Polar n) Source #

Does not satify lens laws.

Instance details

Defined in Diagrams.Coordinates.Polar

Wrapped (Polar a) Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Associated Types

type Unwrapped (Polar a) #

Methods

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

Polar a1 ~ t => Rewrapped (Polar a2) t Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

(TypeableFloat n, Renderable (Path V2 n) b, Mainable (QDiagram b V2 n Any)) => Mainable (Axis b Polar n) Source # 
Instance details

Defined in Plots.Axis.Render

Associated Types

type MainOpts (Axis b Polar n) #

Methods

mainArgs :: Parseable (MainOpts (Axis b Polar n)) => proxy (Axis b Polar n) -> IO (MainOpts (Axis b Polar n)) #

mainRender :: MainOpts (Axis b Polar n) -> Axis b Polar n -> IO () #

mainWith :: Axis b Polar n -> IO () #

type Rep Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

type Rep Polar = E Polar
type BaseSpace Polar Source # 
Instance details

Defined in Plots.Axis

type Rep1 Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

type Rep1 Polar = D1 ('MetaData "Polar" "Diagrams.Coordinates.Polar" "plots-0.1.1.4-inplace" 'True) (C1 ('MetaCons "Polar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 V2)))
type Unwrapped (Polar a) Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

type Unwrapped (Polar a) = V2 a
type MainOpts (Axis b Polar n) Source # 
Instance details

Defined in Plots.Axis.Render

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

Instances details
Radial Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

_radial :: Lens' (Polar a) 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

Instances details
Circle Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

class HasX t where Source #

Coordinate with at least one dimension where the x coordinate can be retrieved 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 retrieved numerically.

Methods

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

Instances

Instances details
HasX V2 Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

HasX V3 Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

HasX Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

HasX v => HasX (Point v) Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

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

Instances details
HasY V2 Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

HasY V3 Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

HasY Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

HasY v => HasY (Point v) Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

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

class HasR (t :: Type -> Type) where #

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

Methods

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

Instances

Instances details
HasR V2 
Instance details

Defined in Diagrams.TwoD.Types

Methods

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

HasR Polar Source # 
Instance details

Defined in Diagrams.Coordinates.Polar

Methods

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

HasR v => HasR (Point v) 
Instance details

Defined in Diagrams.TwoD.Types

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 #