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

Diagrams.Tangent

Description

Computing tangent and normal vectors for segments and trails.

Synopsis

Documentation

tangentAtParam :: Parametric (Tangent t) => t -> Scalar (V t) -> Codomain (Tangent t) Source

Compute the tangent vector to a segment or trail at a particular parameter.

Examples of more specific types this function can have include

• Segment Closed R2 -> Double -> R2
• Trail' Line R2 -> Double -> R2
• Located (Trail R2) -> Double -> R2

See the instances listed for the Tangent newtype for more.

tangentAtStart :: EndValues (Tangent t) => t -> Codomain (Tangent t) Source

Compute the tangent vector at the start of a segment or trail.

tangentAtEnd :: EndValues (Tangent t) => t -> Codomain (Tangent t) Source

Compute the tangent vector at the end of a segment or trail.

normalAtParam :: (Codomain (Tangent t) ~ R2, Parametric (Tangent t)) => t -> Scalar (V t) -> R2 Source

Compute the (unit) normal vector to a segment or trail at a particular parameter.

Examples of more specific types this function can have include

• Segment Closed R2 -> Double -> R2
• Trail' Line R2 -> Double -> R2
• Located (Trail R2) -> Double -> P2

See the instances listed for the Tangent newtype for more.

normalAtStart :: (Codomain (Tangent t) ~ R2, EndValues (Tangent t)) => t -> R2 Source

Compute the normal vector at the start of a segment or trail.

normalAtEnd :: (Codomain (Tangent t) ~ R2, EndValues (Tangent t)) => t -> R2 Source

Compute the normal vector at the end of a segment or trail.

newtype Tangent t Source

A newtype wrapper used to give different instances of Parametric and EndValues that compute tangent vectors.

Constructors

 Tangent t

Instances

 (DomainBounds t, EndValues (Tangent t)) => EndValues (Tangent (Located t)) (VectorSpace v, Num (Scalar v)) => EndValues (Tangent (Segment Closed v)) (InnerSpace v, OrderedField (Scalar v), RealFrac (Scalar v)) => EndValues (Tangent (Trail v)) (Parametric (GetSegment (Trail' c v)), EndValues (GetSegment (Trail' c v)), VectorSpace v, Num (Scalar v)) => EndValues (Tangent (Trail' c v)) DomainBounds t => DomainBounds (Tangent t) Parametric (Tangent t) => Parametric (Tangent (Located t)) (VectorSpace v, Num (Scalar v)) => Parametric (Tangent (Segment Closed v)) (InnerSpace v, OrderedField (Scalar v), RealFrac (Scalar v)) => Parametric (Tangent (Trail v)) (Parametric (GetSegment (Trail' c v)), VectorSpace v, Num (Scalar v)) => Parametric (Tangent (Trail' c v)) type V (Tangent t) = V t type Codomain (Tangent (Located t)) = Codomain (Tangent t) type Codomain (Tangent (Segment Closed v)) = Codomain (Segment Closed v) type Codomain (Tangent (Trail v)) = Codomain (Trail v) type Codomain (Tangent (Trail' c v)) = Codomain (Trail' c v)