Hoogle Search
Within LTS Haskell 24.69 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
segOffset :: Segment Closed v n -> v ndiagrams-lib Diagrams.Segment Compute the offset from the start of a segment to the end. Note that in the case of a Bézier segment this is not the same as the length of the curve itself; for that, see arcLength.
closeTrail :: forall (v :: Type -> Type) n . Trail v n -> Trail v ndiagrams-lib Diagrams.Trail closeTrail is a variant of closeLine for Trail, which performs closeLine on lines and is the identity on loops.
lineFromOffsets :: (Metric v, OrderedField n) => [v n] -> Trail' Line v ndiagrams-lib Diagrams.Trail Construct a line containing only linear segments from a list of vectors, where each vector represents the offset from one vertex to the next. See also fromOffsets.
import Diagrams.Coordinates lineFromOffsetsEx = strokeLine $ lineFromOffsets [ 2 ^& 1, 2 ^& (-1), 2 ^& 0.5 ]
lineOffset :: (Metric v, OrderedField n) => Trail' Line v n -> v ndiagrams-lib Diagrams.Trail Compute the offset from the start of a line to the end. (Note, there is no corresponding loopOffset function because by definition it would be constantly zero.)
lineOffsets :: Trail' Line v n -> [v n]diagrams-lib Diagrams.Trail Extract the offsets of the segments of a line.
loopOffsets :: (Metric v, OrderedField n) => Trail' Loop v n -> [v n]diagrams-lib Diagrams.Trail Extract the offsets of the segments of a loop.
offset :: (OrderedField n, Metric v, Measured (SegMeasure v n) t) => t -> v ndiagrams-lib Diagrams.Trail Compute the total offset of anything measured by SegMeasure.
reverseTrail :: forall (v :: Type -> Type) n . (Metric v, OrderedField n) => Trail v n -> Trail v ndiagrams-lib Diagrams.Trail Reverse a trail. Semantically, if a trail given by a function t from [0,1] to vectors, then the reverse of t is given by t'(s) = t(1-s). reverseTrail is an involution, that is,
reverseTrail . reverseTrail === id
trailFromOffsets :: (Metric v, OrderedField n) => [v n] -> Trail v ndiagrams-lib Diagrams.Trail trailFromOffsets === wrapTrail . lineFromOffsets, for conveniently constructing a Trail instead of a Trail' Line.
trailOffset :: (Metric v, OrderedField n) => Trail v n -> v ndiagrams-lib Diagrams.Trail Compute the offset from the start of a trail to the end. Satisfies
trailOffset === sumV . trailOffsets
but is more efficient.trailOffsetEx = (strokeLine almostClosed <> showOffset) # centerXY # pad 1.1 where showOffset = fromOffsets [trailOffset (wrapLine almostClosed)] # strokeP # lc red