diagrams-lib-1.5.1: Embedded domain-specific language for declarative graphics

Copyright | (c) 2013 diagrams-lib team (see LICENSE)
License | BSD-style (see LICENSE)
Maintainer | diagrams-discuss@googlegroups.com
Safe Haskell | Safe-Inferred
Language | Haskell2010

Diagrams.Parametric

Description

Type classes for things which are parameterized in some way, e.g. segments and trails.

Synopsis

- stdTolerance :: Fractional a => a
- type family Codomain p :: Type -> Type
- class Parametric p where
  - atParam :: p -> N p -> Codomain p (N p)
- class DomainBounds p where
  - domainLower :: p -> N p
  - domainUpper :: p -> N p
- domainBounds :: DomainBounds p => p -> (N p, N p)
- class (Parametric p, DomainBounds p) => EndValues p where
  - atStart :: p -> Codomain p (N p)
  - atEnd :: p -> Codomain p (N p)
- class DomainBounds p => Sectionable p where
  - splitAtParam :: p -> N p -> (p, p)
  - section :: p -> N p -> N p -> p
  - reverseDomain :: p -> p
- class Parametric p => HasArcLength p where
  - arcLengthBounded :: N p -> p -> Interval (N p)
  - arcLength :: N p -> p -> N p
  - stdArcLength :: p -> N p
  - arcLengthToParam :: N p -> p -> N p -> N p
  - stdArcLengthToParam :: p -> N p -> N p

# Documentation

stdTolerance :: Fractional a => a Source #

The standard tolerance used by `std...` functions (like `stdArcLength` and `stdArcLengthToParam`, currently set at `1e-6`.

type family Codomain p :: Type -> Type Source #

Codomain of parametric classes. This is usually either `(V p)`, for relative vector results, or `(Point (V p))`, for functions with absolute coordinates.

#### Instances

Instances details

type Codomain (Located a) Source # |
Instance details Defined in Diagrams.Located type Codomain (Located a) = Point (Codomain a)
type Codomain (Tangent t) Source # |
Instance details Defined in Diagrams.Tangent type Codomain (Tangent t) = V t
type Codomain (GetSegment t) Source # |
Instance details Defined in Diagrams.Trail type Codomain (GetSegment t) = GetSegmentCodomain (V t)
type Codomain (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein type Codomain (BernsteinPoly n) = V1
type Codomain (FixedSegment v n) Source # |
Instance details Defined in Diagrams.Segment type Codomain (FixedSegment v n) = Point v
type Codomain (SegTree v n) Source # |
Instance details Defined in Diagrams.Trail type Codomain (SegTree v n) = v
type Codomain (Trail v n) Source # |
Instance details Defined in Diagrams.Trail type Codomain (Trail v n) = v
type Codomain (Segment Closed v n) Source # |
Instance details Defined in Diagrams.Segment type Codomain (Segment Closed v n) = v
type Codomain (Trail' l v n) Source # |
Instance details Defined in Diagrams.Trail type Codomain (Trail' l v n) = v

class Parametric p where Source #

Type class for parametric functions.

Methods

atParam :: p -> N p -> Codomain p (N p) Source #

`atParam` yields a parameterized view of an object as a continuous function. It is designed to be used infix, like `path ``atParam`` 0.5`.

#### Instances

Instances details

(InSpace v n a, Parametric a, Codomain a ~ v) => Parametric (Located a) Source # |
Instance details Defined in Diagrams.Located Methods atParam :: Located a -> N (Located a) -> Codomain (Located a) (N (Located a)) Source #
Parametric (Tangent t) => Parametric (Tangent (Located t)) Source # |
Instance details Defined in Diagrams.Tangent Methods atParam :: Tangent (Located t) -> N (Tangent (Located t)) -> Codomain (Tangent (Located t)) (N (Tangent (Located t))) Source #
(Additive v, Num n) => Parametric (Tangent (FixedSegment v n)) Source # |
Instance details Defined in Diagrams.Tangent Methods atParam :: Tangent (FixedSegment v n) -> N (Tangent (FixedSegment v n)) -> Codomain (Tangent (FixedSegment v n)) (N (Tangent (FixedSegment v n))) Source #
(Additive v, Num n) => Parametric (Tangent (Segment Closed v n)) Source # |
Instance details Defined in Diagrams.Tangent Methods atParam :: Tangent (Segment Closed v n) -> N (Tangent (Segment Closed v n)) -> Codomain (Tangent (Segment Closed v n)) (N (Tangent (Segment Closed v n))) Source #
(Metric v, OrderedField n, Real n) => Parametric (Tangent (Trail v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atParam :: Tangent (Trail v n) -> N (Tangent (Trail v n)) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) Source #
(Parametric (GetSegment (Trail' c v n)), Additive v, Num n) => Parametric (Tangent (Trail' c v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atParam :: Tangent (Trail' c v n) -> N (Tangent (Trail' c v n)) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) Source #
(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atParam :: GetSegment (Trail v n) -> N (GetSegment (Trail v n)) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) Source #
(Metric v, OrderedField n) => Parametric (GetSegment (Trail' Line v n)) Source # | Parameters less than 0 yield the first segment; parameters greater than 1 yield the last. A parameter exactly at the junction of two segments yields the second segment (i.e. the one with higher parameter values).
Instance details Defined in Diagrams.Trail Methods atParam :: GetSegment (Trail' Line v n) -> N (GetSegment (Trail' Line v n)) -> Codomain (GetSegment (Trail' Line v n)) (N (GetSegment (Trail' Line v n))) Source #
(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail' Loop v n)) Source # | The parameterization for loops wraps around, i.e. parameters are first reduced "mod 1".
Instance details Defined in Diagrams.Trail Methods atParam :: GetSegment (Trail' Loop v n) -> N (GetSegment (Trail' Loop v n)) -> Codomain (GetSegment (Trail' Loop v n)) (N (GetSegment (Trail' Loop v n))) Source #
Fractional n => Parametric (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein Methods atParam :: BernsteinPoly n -> N (BernsteinPoly n) -> Codomain (BernsteinPoly n) (N (BernsteinPoly n)) Source #
(Additive v, Num n) => Parametric (FixedSegment v n) Source # |
Instance details Defined in Diagrams.Segment Methods atParam :: FixedSegment v n -> N (FixedSegment v n) -> Codomain (FixedSegment v n) (N (FixedSegment v n)) Source #
(Metric v, OrderedField n, Real n) => Parametric (SegTree v n) Source # |
Instance details Defined in Diagrams.Trail Methods atParam :: SegTree v n -> N (SegTree v n) -> Codomain (SegTree v n) (N (SegTree v n)) Source #
(Metric v, OrderedField n, Real n) => Parametric (Trail v n) Source # |
Instance details Defined in Diagrams.Trail Methods atParam :: Trail v n -> N (Trail v n) -> Codomain (Trail v n) (N (Trail v n)) Source #
(Additive v, Num n) => Parametric (Segment Closed v n) Source # | `atParam` yields a parametrized view of segments as continuous functions `[0,1] -> v`, which give the offset from the start of the segment for each value of the parameter between `0` and `1`. It is designed to be used infix, like `seg ``atParam`` 0.5`.
Instance details Defined in Diagrams.Segment Methods atParam :: Segment Closed v n -> N (Segment Closed v n) -> Codomain (Segment Closed v n) (N (Segment Closed v n)) Source #
(Metric v, OrderedField n, Real n) => Parametric (Trail' l v n) Source # |
Instance details Defined in Diagrams.Trail Methods atParam :: Trail' l v n -> N (Trail' l v n) -> Codomain (Trail' l v n) (N (Trail' l v n)) Source #

class DomainBounds p where Source #

Type class for parametric functions with a bounded domain. The default bounds are `[0,1]`.

Note that this domain indicates the main "interesting" portion of the function. It must be defined within this range, but for some instances may still have sensible values outside.

Minimal complete definition

Nothing

Methods

domainLower :: p -> N p Source #

`domainLower` defaults to being constantly 0 (for vector spaces with numeric scalars).

default domainLower :: Num (N p) => p -> N p Source #

domainUpper :: p -> N p Source #

`domainUpper` defaults to being constantly 1 (for vector spaces with numeric scalars).

default domainUpper :: Num (N p) => p -> N p Source #

#### Instances

Instances details

DomainBounds a => DomainBounds (Located a) Source # |
Instance details Defined in Diagrams.Located Methods domainLower :: Located a -> N (Located a) Source # domainUpper :: Located a -> N (Located a) Source #
DomainBounds t => DomainBounds (Tangent t) Source # |
Instance details Defined in Diagrams.Tangent Methods domainLower :: Tangent t -> N (Tangent t) Source # domainUpper :: Tangent t -> N (Tangent t) Source #
DomainBounds t => DomainBounds (GetSegment t) Source # |
Instance details Defined in Diagrams.Trail Methods domainLower :: GetSegment t -> N (GetSegment t) Source # domainUpper :: GetSegment t -> N (GetSegment t) Source #
Num n => DomainBounds (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein Methods domainLower :: BernsteinPoly n -> N (BernsteinPoly n) Source # domainUpper :: BernsteinPoly n -> N (BernsteinPoly n) Source #
Num n => DomainBounds (FixedSegment v n) Source # |
Instance details Defined in Diagrams.Segment Methods domainLower :: FixedSegment v n -> N (FixedSegment v n) Source # domainUpper :: FixedSegment v n -> N (FixedSegment v n) Source #
Num n => DomainBounds (SegTree v n) Source # |
Instance details Defined in Diagrams.Trail Methods domainLower :: SegTree v n -> N (SegTree v n) Source # domainUpper :: SegTree v n -> N (SegTree v n) Source #
Num n => DomainBounds (Trail v n) Source # |
Instance details Defined in Diagrams.Trail Methods domainLower :: Trail v n -> N (Trail v n) Source # domainUpper :: Trail v n -> N (Trail v n) Source #
Num n => DomainBounds (Segment Closed v n) Source # |
Instance details Defined in Diagrams.Segment Methods domainLower :: Segment Closed v n -> N (Segment Closed v n) Source # domainUpper :: Segment Closed v n -> N (Segment Closed v n) Source #
Num n => DomainBounds (Trail' l v n) Source # |
Instance details Defined in Diagrams.Trail Methods domainLower :: Trail' l v n -> N (Trail' l v n) Source # domainUpper :: Trail' l v n -> N (Trail' l v n) Source #

domainBounds :: DomainBounds p => p -> (N p, N p) Source #

Return the lower and upper bounds of a parametric domain together as a pair.

class (Parametric p, DomainBounds p) => EndValues p where Source #

Type class for querying the values of a parametric object at the ends of its domain.

Minimal complete definition

Nothing

Methods

atStart :: p -> Codomain p (N p) Source #

`atStart` is the value at the start of the domain. That is,

    atStart x = x `atParam` domainLower x

This is the default implementation, but some representations will have a more efficient and/or precise implementation.

atEnd :: p -> Codomain p (N p) Source #

`atEnd` is the value at the end of the domain. That is,

    atEnd x = x `atParam` domainUpper x

This is the default implementation, but some representations will have a more efficient and/or precise implementation.

#### Instances

Instances details

(InSpace v n a, EndValues a, Codomain a ~ v) => EndValues (Located a) Source # |
Instance details Defined in Diagrams.Located Methods atStart :: Located a -> Codomain (Located a) (N (Located a)) Source # atEnd :: Located a -> Codomain (Located a) (N (Located a)) Source #
(DomainBounds t, EndValues (Tangent t)) => EndValues (Tangent (Located t)) Source # |
Instance details Defined in Diagrams.Tangent Methods atStart :: Tangent (Located t) -> Codomain (Tangent (Located t)) (N (Tangent (Located t))) Source # atEnd :: Tangent (Located t) -> Codomain (Tangent (Located t)) (N (Tangent (Located t))) Source #
(Additive v, Num n) => EndValues (Tangent (FixedSegment v n)) Source # |
Instance details Defined in Diagrams.Tangent Methods atStart :: Tangent (FixedSegment v n) -> Codomain (Tangent (FixedSegment v n)) (N (Tangent (FixedSegment v n))) Source # atEnd :: Tangent (FixedSegment v n) -> Codomain (Tangent (FixedSegment v n)) (N (Tangent (FixedSegment v n))) Source #
(Additive v, Num n) => EndValues (Tangent (Segment Closed v n)) Source # |
Instance details Defined in Diagrams.Tangent Methods atStart :: Tangent (Segment Closed v n) -> Codomain (Tangent (Segment Closed v n)) (N (Tangent (Segment Closed v n))) Source # atEnd :: Tangent (Segment Closed v n) -> Codomain (Tangent (Segment Closed v n)) (N (Tangent (Segment Closed v n))) Source #
(Metric v, OrderedField n, Real n) => EndValues (Tangent (Trail v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) Source # atEnd :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) Source #
(Parametric (GetSegment (Trail' c v n)), EndValues (GetSegment (Trail' c v n)), Additive v, Num n) => EndValues (Tangent (Trail' c v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) Source # atEnd :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) Source #
(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) Source # atEnd :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) Source #
(Metric v, OrderedField n) => EndValues (GetSegment (Trail' Line v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: GetSegment (Trail' Line v n) -> Codomain (GetSegment (Trail' Line v n)) (N (GetSegment (Trail' Line v n))) Source # atEnd :: GetSegment (Trail' Line v n) -> Codomain (GetSegment (Trail' Line v n)) (N (GetSegment (Trail' Line v n))) Source #
(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail' Loop v n)) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: GetSegment (Trail' Loop v n) -> Codomain (GetSegment (Trail' Loop v n)) (N (GetSegment (Trail' Loop v n))) Source # atEnd :: GetSegment (Trail' Loop v n) -> Codomain (GetSegment (Trail' Loop v n)) (N (GetSegment (Trail' Loop v n))) Source #
Fractional n => EndValues (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein Methods atStart :: BernsteinPoly n -> Codomain (BernsteinPoly n) (N (BernsteinPoly n)) Source # atEnd :: BernsteinPoly n -> Codomain (BernsteinPoly n) (N (BernsteinPoly n)) Source #
(Additive v, Num n) => EndValues (FixedSegment v n) Source # |
Instance details Defined in Diagrams.Segment Methods atStart :: FixedSegment v n -> Codomain (FixedSegment v n) (N (FixedSegment v n)) Source # atEnd :: FixedSegment v n -> Codomain (FixedSegment v n) (N (FixedSegment v n)) Source #
(Metric v, OrderedField n, Real n) => EndValues (SegTree v n) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: SegTree v n -> Codomain (SegTree v n) (N (SegTree v n)) Source # atEnd :: SegTree v n -> Codomain (SegTree v n) (N (SegTree v n)) Source #
(Metric v, OrderedField n, Real n) => EndValues (Trail v n) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: Trail v n -> Codomain (Trail v n) (N (Trail v n)) Source # atEnd :: Trail v n -> Codomain (Trail v n) (N (Trail v n)) Source #
(Additive v, Num n) => EndValues (Segment Closed v n) Source # |
Instance details Defined in Diagrams.Segment Methods atStart :: Segment Closed v n -> Codomain (Segment Closed v n) (N (Segment Closed v n)) Source # atEnd :: Segment Closed v n -> Codomain (Segment Closed v n) (N (Segment Closed v n)) Source #
(Metric v, OrderedField n, Real n) => EndValues (Trail' l v n) Source # |
Instance details Defined in Diagrams.Trail Methods atStart :: Trail' l v n -> Codomain (Trail' l v n) (N (Trail' l v n)) Source # atEnd :: Trail' l v n -> Codomain (Trail' l v n) (N (Trail' l v n)) Source #

class DomainBounds p => Sectionable p where Source #

Type class for parametric objects which can be split into subobjects.

Minimal definition: Either `splitAtParam` or `section`, plus `reverseDomain`.

Minimal complete definition

reverseDomain

Methods

splitAtParam :: p -> N p -> (p, p) Source #

`splitAtParam` splits an object `p` into two new objects `(l,r)` at the parameter `t`, where `l` corresponds to the portion of `p` for parameter values from `0` to `t` and `r` for to that from `t` to `1`. The following property should hold:

      prop_splitAtParam f t u =
        | u < t     = atParam f u == atParam l (u / t)
        | otherwise = atParam f u == atParam f t ??? atParam l ((u - t) / (domainUpper f - t))
        where (l,r) = splitAtParam f t

where `(???) = (^+^)` if the codomain is a vector type, or `const flip` if the codomain is a point type. Stated more intuitively, all this is to say that the parameterization scales linearly with splitting.

`splitAtParam` can also be used with parameters outside the range of the domain. For example, using the parameter `2` with a path (where the domain is the default `[0,1]`) gives two result paths where the first is the original path extended to the parameter 2, and the second result path travels backwards from the end of the first to the end of the original path.

section :: p -> N p -> N p -> p Source #

Extract a particular section of the domain, linearly reparameterized to the same domain as the original. Should satisfy the property:

    prop_section x l u t =
      let s = section x l u
      in     domainBounds x == domainBounds x
          && (x `atParam` lerp l u t) == (s `atParam` t)

That is, the section should have the same domain as the original, and the reparameterization should be linear.

default section :: Fractional (N p) => p -> N p -> N p -> p Source #

reverseDomain :: p -> p Source #

Flip the parameterization on the domain.

#### Instances

Instances details

(InSpace v n a, Fractional n, Parametric a, Sectionable a, Codomain a ~ v) => Sectionable (Located a) Source # |
Instance details Defined in Diagrams.Located Methods splitAtParam :: Located a -> N (Located a) -> (Located a, Located a) Source # section :: Located a -> N (Located a) -> N (Located a) -> Located a Source # reverseDomain :: Located a -> Located a Source #
Fractional n => Sectionable (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein Methods splitAtParam :: BernsteinPoly n -> N (BernsteinPoly n) -> (BernsteinPoly n, BernsteinPoly n) Source # section :: BernsteinPoly n -> N (BernsteinPoly n) -> N (BernsteinPoly n) -> BernsteinPoly n Source # reverseDomain :: BernsteinPoly n -> BernsteinPoly n Source #
(Additive v, Fractional n) => Sectionable (FixedSegment v n) Source # |
Instance details Defined in Diagrams.Segment Methods splitAtParam :: FixedSegment v n -> N (FixedSegment v n) -> (FixedSegment v n, FixedSegment v n) Source # section :: FixedSegment v n -> N (FixedSegment v n) -> N (FixedSegment v n) -> FixedSegment v n Source # reverseDomain :: FixedSegment v n -> FixedSegment v n Source #
(Metric v, OrderedField n, Real n) => Sectionable (SegTree v n) Source # |
Instance details Defined in Diagrams.Trail Methods splitAtParam :: SegTree v n -> N (SegTree v n) -> (SegTree v n, SegTree v n) Source # section :: SegTree v n -> N (SegTree v n) -> N (SegTree v n) -> SegTree v n Source # reverseDomain :: SegTree v n -> SegTree v n Source #

(Metric v, OrderedField n, Real n) => Sectionable (Trail v n) Source #

Note that there is no `Sectionable` instance for `Trail' Loop`, because it does not make sense (splitting a loop at a parameter results in a single line, not two loops). However, it's convenient to have a `Sectionable` instance for `Trail`; if the `Trail` contains a loop the loop will first be cut and then `splitAtParam` called on the resulting line. This is semantically a bit silly, so please don't rely on it. (*E.g.* if this is really the behavior you want, consider first calling `cutLoop` yourself.)

Instance details Defined in Diagrams.Trail Methods splitAtParam :: Trail v n -> N (Trail v n) -> (Trail v n, Trail v n) Source # section :: Trail v n -> N (Trail v n) -> N (Trail v n) -> Trail v n Source # reverseDomain :: Trail v n -> Trail v n Source #
(Additive v, Fractional n) => Sectionable (Segment Closed v n) Source # |
Instance details Defined in Diagrams.Segment Methods splitAtParam :: Segment Closed v n -> N (Segment Closed v n) -> (Segment Closed v n, Segment Closed v n) Source # section :: Segment Closed v n -> N (Segment Closed v n) -> N (Segment Closed v n) -> Segment Closed v n Source # reverseDomain :: Segment Closed v n -> Segment Closed v n Source #
(Metric v, OrderedField n, Real n) => Sectionable (Trail' Line v n) Source # |
Instance details Defined in Diagrams.Trail Methods splitAtParam :: Trail' Line v n -> N (Trail' Line v n) -> (Trail' Line v n, Trail' Line v n) Source # section :: Trail' Line v n -> N (Trail' Line v n) -> N (Trail' Line v n) -> Trail' Line v n Source # reverseDomain :: Trail' Line v n -> Trail' Line v n Source #

class Parametric p => HasArcLength p where Source #

Type class for parametric things with a notion of arc length.

Minimal complete definition

arcLengthBounded, arcLengthToParam

Methods

arcLengthBounded :: N p -> p -> Interval (N p) Source #

`arcLengthBounded eps x` approximates the arc length of `x`. The true arc length is guaranteed to lie within the interval returned, which will have a size of at most `eps`.

arcLength :: N p -> p -> N p Source #

`arcLength eps s` approximates the arc length of `x` up to the accuracy `eps` (plus or minus).

default arcLength :: Fractional (N p) => N p -> p -> N p Source #

stdArcLength :: p -> N p Source #

Approximate the arc length up to a standard accuracy of `stdTolerance` (`1e-6`).

default stdArcLength :: Fractional (N p) => p -> N p Source #

arcLengthToParam :: N p -> p -> N p -> N p Source #

``arcLengthToParam` eps s l` converts the absolute arc length `l`, measured from the start of the domain, to a parameter on the object `s`. The true arc length at the parameter returned is guaranteed to be within `eps` of the requested arc length.

This should work for any arc length, and may return any parameter value (not just parameters in the domain).

stdArcLengthToParam :: p -> N p -> N p Source #

A simple interface to convert arc length to a parameter, guaranteed to be accurate within `stdTolerance`, or `1e-6`.

default stdArcLengthToParam :: Fractional (N p) => p -> N p -> N p Source #

#### Instances

Instances details

(InSpace v n a, Fractional n, HasArcLength a, Codomain a ~ v) => HasArcLength (Located a) Source # |

Instance details

Defined in Diagrams.Located

Methods

arcLengthBounded :: N (Located a) -> Located a -> Interval (N (Located a)) Source #

arcLength :: N (Located a) -> Located a -> N (Located a) Source #

stdArcLength :: Located a -> N (Located a) Source #

arcLengthToParam :: N (Located a) -> Located a -> N (Located a) -> N (Located a) Source #

stdArcLengthToParam :: Located a -> N (Located a) -> N (Located a) Source #

(Metric v, OrderedField n) => HasArcLength (FixedSegment v n) Source # |

Instance details

Defined in Diagrams.Segment

Methods

arcLengthBounded :: N (FixedSegment v n) -> FixedSegment v n -> Interval (N (FixedSegment v n)) Source #

arcLength :: N (FixedSegment v n) -> FixedSegment v n -> N (FixedSegment v n) Source #

stdArcLength :: FixedSegment v n -> N (FixedSegment v n) Source #

arcLengthToParam :: N (FixedSegment v n) -> FixedSegment v n -> N (FixedSegment v n) -> N (FixedSegment v n) Source #

stdArcLengthToParam :: FixedSegment v n -> N (FixedSegment v n) -> N (FixedSegment v n) Source #

(Metric v, OrderedField n, Real n) => HasArcLength (SegTree v n) Source # |

Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (SegTree v n) -> SegTree v n -> Interval (N (SegTree v n)) Source #

arcLength :: N (SegTree v n) -> SegTree v n -> N (SegTree v n) Source #

stdArcLength :: SegTree v n -> N (SegTree v n) Source #

arcLengthToParam :: N (SegTree v n) -> SegTree v n -> N (SegTree v n) -> N (SegTree v n) Source #

stdArcLengthToParam :: SegTree v n -> N (SegTree v n) -> N (SegTree v n) Source #

(Metric v, OrderedField n, Real n) => HasArcLength (Trail v n) Source # |

Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (Trail v n) -> Trail v n -> Interval (N (Trail v n)) Source #

arcLength :: N (Trail v n) -> Trail v n -> N (Trail v n) Source #

stdArcLength :: Trail v n -> N (Trail v n) Source #

arcLengthToParam :: N (Trail v n) -> Trail v n -> N (Trail v n) -> N (Trail v n) Source #

stdArcLengthToParam :: Trail v n -> N (Trail v n) -> N (Trail v n) Source #

(Metric v, OrderedField n) => HasArcLength (Segment Closed v n) Source # |

Instance details

Defined in Diagrams.Segment

Methods

arcLengthBounded :: N (Segment Closed v n) -> Segment Closed v n -> Interval (N (Segment Closed v n)) Source #

arcLength :: N (Segment Closed v n) -> Segment Closed v n -> N (Segment Closed v n) Source #

stdArcLength :: Segment Closed v n -> N (Segment Closed v n) Source #

arcLengthToParam :: N (Segment Closed v n) -> Segment Closed v n -> N (Segment Closed v n) -> N (Segment Closed v n) Source #

stdArcLengthToParam :: Segment Closed v n -> N (Segment Closed v n) -> N (Segment Closed v n) Source #

(Metric v, OrderedField n, Real n) => HasArcLength (Trail' l v n) Source # |

Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (Trail' l v n) -> Trail' l v n -> Interval (N (Trail' l v n)) Source #

arcLength :: N (Trail' l v n) -> Trail' l v n -> N (Trail' l v n) Source #

stdArcLength :: Trail' l v n -> N (Trail' l v n) Source #

arcLengthToParam :: N (Trail' l v n) -> Trail' l v n -> N (Trail' l v n) -> N (Trail' l v n) Source #

stdArcLengthToParam :: Trail' l v n -> N (Trail' l v n) -> N (Trail' l v n) Source #