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

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

Diagrams.TwoD.Segment.Bernstein

Description

Bernstein polynomials, used internally by code to find intersections of paths. This module is probably not of any relevance to most users of diagrams.

Synopsis

- data BernsteinPoly n = BernsteinPoly {
  - bernsteinDegree :: Int
  - bernsteinCoeffs :: [n]
  }
- listToBernstein :: Fractional n => [n] -> BernsteinPoly n
- evaluateBernstein :: Fractional n => BernsteinPoly n -> n -> n
- degreeElevate :: Fractional n => BernsteinPoly n -> Int -> BernsteinPoly n
- bernsteinDeriv :: Fractional n => BernsteinPoly n -> BernsteinPoly n
- evaluateBernsteinDerivs :: Fractional n => BernsteinPoly n -> n -> [n]

# Documentation

data BernsteinPoly n Source #

Constructors

BernsteinPoly |

Fields

- bernsteinDegree :: Int
- bernsteinCoeffs :: [n]

Instances

Functor BernsteinPoly Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein Methods fmap :: (a -> b) -> BernsteinPoly a -> BernsteinPoly b Source # (<$) :: a -> BernsteinPoly b -> BernsteinPoly a Source #
Fractional n => Num (BernsteinPoly n) Source # |

Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

Methods

(+) :: BernsteinPoly n -> BernsteinPoly n -> BernsteinPoly n Source #

(-) :: BernsteinPoly n -> BernsteinPoly n -> BernsteinPoly n Source #

(*) :: BernsteinPoly n -> BernsteinPoly n -> BernsteinPoly n Source #

negate :: BernsteinPoly n -> BernsteinPoly n Source #

abs :: BernsteinPoly n -> BernsteinPoly n Source #

signum :: BernsteinPoly n -> BernsteinPoly n Source #

fromInteger :: Integer -> BernsteinPoly n Source #

Show n => Show (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein Methods showsPrec :: Int -> BernsteinPoly n -> ShowS Source # show :: BernsteinPoly n -> String Source # showList :: [BernsteinPoly n] -> ShowS 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 #
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 #
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 #
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 #
type V (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein type V (BernsteinPoly n) = V1
type N (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein type N (BernsteinPoly n) = n
type Codomain (BernsteinPoly n) Source # |
Instance details Defined in Diagrams.TwoD.Segment.Bernstein type Codomain (BernsteinPoly n) = V1

listToBernstein :: Fractional n => [n] -> BernsteinPoly n Source #

Create a bernstein polynomial from a list of coëfficients.

evaluateBernstein :: Fractional n => BernsteinPoly n -> n -> n Source #

Evaluate the bernstein polynomial.

degreeElevate :: Fractional n => BernsteinPoly n -> Int -> BernsteinPoly n Source #

Degree elevate a bernstein polynomial a number of times.

bernsteinDeriv :: Fractional n => BernsteinPoly n -> BernsteinPoly n Source #

Find the derivative of a bernstein polynomial.

evaluateBernsteinDerivs :: Fractional n => BernsteinPoly n -> n -> [n] Source #

Evaluate the bernstein polynomial and its derivatives.