/usr/share/doc/libghc-diagrams-lib-doc/html/Diagrams-Segment.html is in libghc-diagrams-lib-doc 1.2.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Diagrams.Segment</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Diagrams-Segment.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Diagrams-Segment.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">diagrams-lib-1.2.0.3: Embedded domain-specific language for declarative graphics</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Maintainer</th><td>diagrams-discuss@googlegroups.com</td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Diagrams.Segment</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Open/closed tags
</a></li><li><a href="#g:2">Segment offsets
</a></li><li><a href="#g:3">Constructing and modifying segments
</a></li><li><a href="#g:4">Fixed (absolutely located) segments
</a></li><li><a href="#g:5">Segment measures
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A <em>segment</em> is a translation-invariant, atomic path. Currently,
there are two types: linear (<em>i.e.</em> just a straight line to the
endpoint) and cubic Bézier curves (<em>i.e.</em> a curve to an endpoint
with two control points). This module contains tools for creating
and manipulating segments, as well as a definition of segments with
a fixed location (useful for backend implementors).
</p><p>Generally speaking, casual users of diagrams should not need this
module; the higher-level functionality provided by
<a href="Diagrams-Trail.html">Diagrams.Trail</a>, <a href="Diagrams-TrailLike.html">Diagrams.TrailLike</a>, and <a href="Diagrams-Path.html">Diagrams.Path</a> should
usually suffice. However, directly manipulating segments can
occasionally be useful.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Open">Open</a> </li><li class="src short"><span class="keyword">data</span> <a href="#t:Closed">Closed</a> </li><li class="src short"><span class="keyword">data</span> <a href="#t:Offset">Offset</a> c v <span class="keyword">where</span><ul class="subs"><li><a href="#v:OffsetOpen">OffsetOpen</a> :: <a href="Diagrams-Segment.html#t:Offset">Offset</a> <a href="Diagrams-Segment.html#t:Open">Open</a> v </li><li><a href="#v:OffsetClosed">OffsetClosed</a> :: !v -> <a href="Diagrams-Segment.html#t:Offset">Offset</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v </li></ul></li><li class="src short"><a href="#v:segOffset">segOffset</a> :: <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v -> v</li><li class="src short"><span class="keyword">data</span> <a href="#t:Segment">Segment</a> c v<ul class="subs"><li>= <a href="#v:Linear">Linear</a> !(<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v) </li><li>| <a href="#v:Cubic">Cubic</a> !v !v !(<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v) </li></ul></li><li class="src short"><a href="#v:straight">straight</a> :: v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v</li><li class="src short"><a href="#v:bezier3">bezier3</a> :: v -> v -> v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v</li><li class="src short"><a href="#v:b-233-zier3">bézier3</a> :: v -> v -> v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v</li><li class="src short"><a href="#v:reverseSegment">reverseSegment</a> :: <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v</li><li class="src short"><span class="keyword">data</span> <a href="#t:FixedSegment">FixedSegment</a> v<ul class="subs"><li>= <a href="#v:FLinear">FLinear</a> (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v) </li><li>| <a href="#v:FCubic">FCubic</a> (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v) </li></ul></li><li class="src short"><a href="#v:mkFixedSeg">mkFixedSeg</a> :: <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="Diagrams-Located.html#t:Located">Located</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v) -> <a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v</li><li class="src short"><a href="#v:fromFixedSeg">fromFixedSeg</a> :: <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v -> <a href="Diagrams-Located.html#t:Located">Located</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:SegCount">SegCount</a> = <a href="#v:SegCount">SegCount</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Sum">Sum</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a>)</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:ArcLength">ArcLength</a> v = <a href="#v:ArcLength">ArcLength</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Sum">Sum</a> (<a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Sum">Sum</a> (<a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)))</li><li class="src short"><a href="#v:getArcLengthCached">getArcLengthCached</a> :: <a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v -> <a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)</li><li class="src short"><a href="#v:getArcLengthFun">getArcLengthFun</a> :: <a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v -> <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v -> <a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)</li><li class="src short"><a href="#v:getArcLengthBounded">getArcLengthBounded</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v -> <a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v -> <a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:TotalOffset">TotalOffset</a> v = <a href="#v:TotalOffset">TotalOffset</a> v</li><li class="src short"><span class="keyword">data</span> <a href="#t:OffsetEnvelope">OffsetEnvelope</a> v = <a href="#v:OffsetEnvelope">OffsetEnvelope</a> {<ul class="subs"><li><a href="#v:_oeOffset">_oeOffset</a> :: !(<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v)</li><li><a href="#v:_oeEnvelope">_oeEnvelope</a> :: <a href="Diagrams-Envelope.html#t:Envelope">Envelope</a> v</li></ul>}</li><li class="src short"><a href="#v:oeOffset">oeOffset</a> :: <span class="keyword">forall</span> v. <a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="Diagrams-Segment.html#t:OffsetEnvelope">OffsetEnvelope</a> v) (<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v)</li><li class="src short"><a href="#v:oeEnvelope">oeEnvelope</a> :: <span class="keyword">forall</span> v. <a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="Diagrams-Segment.html#t:OffsetEnvelope">OffsetEnvelope</a> v) (<a href="Diagrams-Envelope.html#t:Envelope">Envelope</a> v)</li><li class="src short"><span class="keyword">type</span> <a href="#t:SegMeasure">SegMeasure</a> v = <a href="Diagrams-Segment.html#t:SegCount">SegCount</a> <a href="file:///usr/share/doc/libghc-monoid-extras-doc/html/Data-Monoid-MList.html#t::::">:::</a> (<a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v <a href="file:///usr/share/doc/libghc-monoid-extras-doc/html/Data-Monoid-MList.html#t::::">:::</a> (<a href="Diagrams-Segment.html#t:OffsetEnvelope">OffsetEnvelope</a> v <a href="file:///usr/share/doc/libghc-monoid-extras-doc/html/Data-Monoid-MList.html#t::::">:::</a> ()))</li></ul></div><div id="interface"><h1 id="g:1">Open/closed tags
</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Open" class="def">Open</a> <a href="src/Diagrams-Segment.html#Open" class="link">Source</a></p><div class="doc"><p>Type tag for open segments.
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Closed" class="def">Closed</a> <a href="src/Diagrams-Segment.html#Closed" class="link">Source</a></p><div class="doc"><p>Type tag for closed segments.
</p></div><div class="subs instances"><p id="control.i:Closed" class="caption collapser" onclick="toggleSection('i:Closed')">Instances</p><div id="section.i:Closed" class="show"><table><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:EndValues">EndValues</a> (<a href="Diagrams-Tangent.html#t:Tangent">Tangent</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v))</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:Parametric">Parametric</a> (<a href="Diagrams-Tangent.html#t:Tangent">Tangent</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v))</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Envelope.html#t:Enveloped">Enveloped</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc"><p>The envelope for a segment is based at the segment's start.
</p></td></tr><tr><td class="src"><a href="Diagrams-Trace.html#t:Traced">Traced</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Floating">Floating</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v) => <a href="Diagrams-Parametric.html#t:HasArcLength">HasArcLength</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Fractional">Fractional</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:Sectionable">Sectionable</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:EndValues">EndValues</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v) => <a href="Diagrams-Parametric.html#t:DomainBounds">DomainBounds</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:Parametric">Parametric</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc"><p><code><a href="Diagrams-Parametric.html#v:atParam">atParam</a></code> yields a parametrized view of segments as continuous
functions <code>[0,1] -> v</code>, which give the offset from the start of
the segment for each value of the parameter between <code>0</code> and <code>1</code>.
It is designed to be used infix, like <code>seg `<code><a href="Diagrams-Parametric.html#v:atParam">atParam</a></code>` 0.5</code>.
</p></td></tr></table></div></div></div><h1 id="g:2">Segment offsets
</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Offset" class="def">Offset</a> c v <span class="keyword">where</span><a href="src/Diagrams-Segment.html#Offset" class="link">Source</a></p><div class="doc"><p>The <em>offset</em> of a segment is the vector from its starting point
to its end. The offset for an <em>open</em> segment is determined by
the context, <em>i.e.</em> its endpoint is not fixed. The offset for a
<em>closed</em> segment is stored explicitly, <em>i.e.</em> its endpoint is at
a fixed offset from its start.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:OffsetOpen" class="def">OffsetOpen</a> :: <a href="Diagrams-Segment.html#t:Offset">Offset</a> <a href="Diagrams-Segment.html#t:Open">Open</a> v</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:OffsetClosed" class="def">OffsetClosed</a> :: !v -> <a href="Diagrams-Segment.html#t:Offset">Offset</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Offset" class="caption collapser" onclick="toggleSection('i:Offset')">Instances</p><div id="section.i:Offset" class="show"><table><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> (<a href="Diagrams-Segment.html#t:Offset">Offset</a> c)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> (<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Transform.html#t:HasLinearMap">HasLinearMap</a> v => <a href="Diagrams-Transform.html#t:Transformable">Transformable</a> (<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:segOffset" class="def">segOffset</a> :: <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v -> v<a href="src/Diagrams-Segment.html#segOffset" class="link">Source</a></p><div class="doc"><p>Compute the offset from the start of a segment to the
end. Note that in the case of a Bézier segment this is <em>not</em> the
same as the length of the curve itself; for that, see <code><a href="Diagrams-Parametric.html#v:arcLength">arcLength</a></code>.
</p></div></div><h1 id="g:3">Constructing and modifying segments
</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Segment" class="def">Segment</a> c v <a href="src/Diagrams-Segment.html#Segment" class="link">Source</a></p><div class="doc"><p>The atomic constituents of the concrete representation currently
used for trails are <em>segments</em>, currently limited to
single straight lines or cubic Bézier curves. Segments are
<em>translationally invariant</em>, that is, they have no particular
"location" and are unaffected by translations. They are,
however, affected by other transformations such as rotations and
scales.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Linear" class="def">Linear</a> !(<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v)</td><td class="doc"><p>A linear segment with given offset.
</p></td></tr><tr><td class="src"><a name="v:Cubic" class="def">Cubic</a> !v !v !(<a href="Diagrams-Segment.html#t:Offset">Offset</a> c v)</td><td class="doc"><p>A cubic Bézier segment specified by
three offsets from the starting
point to the first control point,
second control point, and ending
point, respectively.
</p></td></tr></table></div><div class="subs instances"><p id="control.i:Segment" class="caption collapser" onclick="toggleSection('i:Segment')">Instances</p><div id="section.i:Segment" class="show"><table><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> c)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:EndValues">EndValues</a> (<a href="Diagrams-Tangent.html#t:Tangent">Tangent</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v))</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:Parametric">Parametric</a> (<a href="Diagrams-Tangent.html#t:Tangent">Tangent</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v))</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> c v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> c v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> c v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Envelope.html#t:Enveloped">Enveloped</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc"><p>The envelope for a segment is based at the segment's start.
</p></td></tr><tr><td class="src"><a href="Diagrams-Trace.html#t:Traced">Traced</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Transform.html#t:HasLinearMap">HasLinearMap</a> v => <a href="Diagrams-Transform.html#t:Transformable">Transformable</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> c v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Floating">Floating</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v) => <a href="Diagrams-Parametric.html#t:HasArcLength">HasArcLength</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Fractional">Fractional</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:Sectionable">Sectionable</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:EndValues">EndValues</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v) => <a href="Diagrams-Parametric.html#t:DomainBounds">DomainBounds</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:Parametric">Parametric</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc"><p><code><a href="Diagrams-Parametric.html#v:atParam">atParam</a></code> yields a parametrized view of segments as continuous
functions <code>[0,1] -> v</code>, which give the offset from the start of
the segment for each value of the parameter between <code>0</code> and <code>1</code>.
It is designed to be used infix, like <code>seg `<code><a href="Diagrams-Parametric.html#v:atParam">atParam</a></code>` 0.5</code>.
</p></td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Transform.html#t:HasLinearMap">HasLinearMap</a> v => <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Renderable">Renderable</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> c v) <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:NullBackend">NullBackend</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:straight" class="def">straight</a> :: v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v<a href="src/Diagrams-Segment.html#straight" class="link">Source</a></p><div class="doc"><p><code><code><a href="Diagrams-Segment.html#v:straight">straight</a></code> v</code> constructs a translationally invariant linear
segment with direction and length given by the vector <code>v</code>.
</p></div></div><div class="top"><p class="src"><a name="v:bezier3" class="def">bezier3</a> :: v -> v -> v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v<a href="src/Diagrams-Segment.html#bezier3" class="link">Source</a></p><div class="doc"><p><code>bezier3 c1 c2 x</code> constructs a translationally invariant cubic
Bézier curve where the offsets from the first endpoint to the
first and second control point and endpoint are respectively
given by <code>c1</code>, <code>c2</code>, and <code>x</code>.
</p></div></div><div class="top"><p class="src"><a name="v:b-233-zier3" class="def">bézier3</a> :: v -> v -> v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v<a href="src/Diagrams-Segment.html#b%E9zier3" class="link">Source</a></p><div class="doc"><p><code>bézier3</code> is the same as <code>bezier3</code>, but with more snobbery.
</p></div></div><div class="top"><p class="src"><a name="v:reverseSegment" class="def">reverseSegment</a> :: <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v -> <a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v<a href="src/Diagrams-Segment.html#reverseSegment" class="link">Source</a></p><div class="doc"><p>Reverse the direction of a segment.
</p></div></div><h1 id="g:4">Fixed (absolutely located) segments
</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:FixedSegment" class="def">FixedSegment</a> v <a href="src/Diagrams-Segment.html#FixedSegment" class="link">Source</a></p><div class="doc"><p><code>FixedSegment</code>s are like <code><a href="Diagrams-Segment.html#t:Segment">Segment</a></code>s except that they have
absolute locations. <code>FixedSegment v</code> is isomorphic to <code>Located
(Segment Closed v)</code>, as witnessed by <code><a href="Diagrams-Segment.html#v:mkFixedSeg">mkFixedSeg</a></code> and
<code><a href="Diagrams-Segment.html#v:fromFixedSeg">fromFixedSeg</a></code>, but <code>FixedSegment</code> is convenient when one needs
the absolute locations of the vertices and control points.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:FLinear" class="def">FLinear</a> (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:FCubic" class="def">FCubic</a> (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v) (<a href="Diagrams-Points.html#t:Point">Point</a> v)</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:FixedSegment" class="caption collapser" onclick="toggleSection('i:FixedSegment')">Instances</p><div id="section.i:FixedSegment" class="show"><table><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Envelope.html#t:Enveloped">Enveloped</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Diagrams-Trace.html#t:Traced">Traced</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Transform.html#t:HasLinearMap">HasLinearMap</a> v => <a href="Diagrams-Transform.html#t:Transformable">Transformable</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v => <a href="Diagrams-Transform.html#t:HasOrigin">HasOrigin</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Fractional">Fractional</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:Sectionable">Sectionable</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="Diagrams-Parametric.html#t:EndValues">EndValues</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v) => <a href="Diagrams-Parametric.html#t:DomainBounds">DomainBounds</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:VectorSpace">VectorSpace</a> v => <a href="Diagrams-Parametric.html#t:Parametric">Parametric</a> (<a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:mkFixedSeg" class="def">mkFixedSeg</a> :: <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="Diagrams-Located.html#t:Located">Located</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v) -> <a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v<a href="src/Diagrams-Segment.html#mkFixedSeg" class="link">Source</a></p><div class="doc"><p>Create a <code><a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a></code> from a located <code><a href="Diagrams-Segment.html#t:Segment">Segment</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:fromFixedSeg" class="def">fromFixedSeg</a> :: <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a> v -> <a href="Diagrams-Located.html#t:Located">Located</a> (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)<a href="src/Diagrams-Segment.html#fromFixedSeg" class="link">Source</a></p><div class="doc"><p>Convert a <code><a href="Diagrams-Segment.html#t:FixedSegment">FixedSegment</a></code> back into a located <code><a href="Diagrams-Segment.html#t:Segment">Segment</a></code>.
</p></div></div><h1 id="g:5">Segment measures
</h1><div class="doc"><p>Trails store a sequence of segments in a fingertree, which can
automatically track various monoidal "measures" on segments.
</p></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:SegCount" class="def">SegCount</a> <a href="src/Diagrams-Segment.html#SegCount" class="link">Source</a></p><div class="doc"><p>A type to track the count of segments in a <code>Trail</code>.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:SegCount" class="def">SegCount</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Sum">Sum</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a>)</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:SegCount" class="caption collapser" onclick="toggleSection('i:SegCount')">Instances</p><div id="section.i:SegCount" class="show"><table><tr><td class="src"><a href="file:///usr/share/doc/libghc-semigroups-doc/html/Data-Semigroup.html#t:Semigroup">Semigroup</a> <a href="Diagrams-Segment.html#t:SegCount">SegCount</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> <a href="Diagrams-Segment.html#t:SegCount">SegCount</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Wrapped.html#t:Wrapped">Wrapped</a> <a href="Diagrams-Segment.html#t:SegCount">SegCount</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Wrapped.html#t:Rewrapped">Rewrapped</a> <a href="Diagrams-Segment.html#t:SegCount">SegCount</a> <a href="Diagrams-Segment.html#t:SegCount">SegCount</a></td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Trail.html#t:SegTree">SegTree</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:ArcLength" class="def">ArcLength</a> v <a href="src/Diagrams-Segment.html#ArcLength" class="link">Source</a></p><div class="doc"><p>A type to represent the total arc length of a chain of
segments. The first component is a "standard" arc length,
computed to within a tolerance of <code>10e-6</code>. The second component is
a generic arc length function taking the tolerance as an
argument.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ArcLength" class="def">ArcLength</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Sum">Sum</a> (<a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Sum">Sum</a> (<a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)))</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:ArcLength" class="caption collapser" onclick="toggleSection('i:ArcLength')">Instances</p><div id="section.i:ArcLength" class="show"><table><tr><td class="src">(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/libghc-semigroups-doc/html/Data-Semigroup.html#t:Semigroup">Semigroup</a> (<a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Wrapped.html#t:Wrapped">Wrapped</a> (<a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Trail.html#t:SegTree">SegTree</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Wrapped.html#t:Rewrapped">Rewrapped</a> (<a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v) (<a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v')</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:getArcLengthCached" class="def">getArcLengthCached</a> :: <a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v -> <a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)<a href="src/Diagrams-Segment.html#getArcLengthCached" class="link">Source</a></p><div class="doc"><p>Project out the cached arc length, stored together with error
bounds.
</p></div></div><div class="top"><p class="src"><a name="v:getArcLengthFun" class="def">getArcLengthFun</a> :: <a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v -> <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v -> <a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)<a href="src/Diagrams-Segment.html#getArcLengthFun" class="link">Source</a></p><div class="doc"><p>Project out the generic arc length function taking the tolerance as
an argument.
</p></div></div><div class="top"><p class="src"><a name="v:getArcLengthBounded" class="def">getArcLengthBounded</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v -> <a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v -> <a href="file:///usr/share/doc/libghc-intervals-doc/html/Numeric-Interval-Kaucher.html#t:Interval">Interval</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)<a href="src/Diagrams-Segment.html#getArcLengthBounded" class="link">Source</a></p><div class="doc"><p>Given a specified tolerance, project out the cached arc length if
it is accurate enough; otherwise call the generic arc length
function with the given tolerance.
</p></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:TotalOffset" class="def">TotalOffset</a> v <a href="src/Diagrams-Segment.html#TotalOffset" class="link">Source</a></p><div class="doc"><p>A type to represent the total cumulative offset of a chain of
segments.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:TotalOffset" class="def">TotalOffset</a> v</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:TotalOffset" class="caption collapser" onclick="toggleSection('i:TotalOffset')">Instances</p><div id="section.i:TotalOffset" class="show"><table><tr><td class="src"><a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="file:///usr/share/doc/libghc-semigroups-doc/html/Data-Semigroup.html#t:Semigroup">Semigroup</a> (<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-AdditiveGroup.html#t:AdditiveGroup">AdditiveGroup</a> v => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Wrapped.html#t:Wrapped">Wrapped</a> (<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Wrapped.html#t:Rewrapped">Rewrapped</a> (<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v) (<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v')</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:OffsetEnvelope" class="def">OffsetEnvelope</a> v <a href="src/Diagrams-Segment.html#OffsetEnvelope" class="link">Source</a></p><div class="doc"><p>A type to represent the offset and envelope of a chain of
segments. They have to be paired into one data structure, since
combining the envelopes of two consecutive chains needs to take
the offset of the the offset of the first into account.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:OffsetEnvelope" class="def">OffsetEnvelope</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:_oeOffset" class="def">_oeOffset</a> :: !(<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:_oeEnvelope" class="def">_oeEnvelope</a> :: <a href="Diagrams-Envelope.html#t:Envelope">Envelope</a> v</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:OffsetEnvelope" class="caption collapser" onclick="toggleSection('i:OffsetEnvelope')">Instances</p><div id="section.i:OffsetEnvelope" class="show"><table><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/libghc-semigroups-doc/html/Data-Semigroup.html#t:Semigroup">Semigroup</a> (<a href="Diagrams-Segment.html#t:OffsetEnvelope">OffsetEnvelope</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v, <a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v)) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Trail.html#t:SegTree">SegTree</a> v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="file:///usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Envelope.html#t:OrderedField">OrderedField</a> (<a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:Scalar">Scalar</a> v), <a href="file:///usr/share/doc/libghc-vector-space-doc/html/Data-VectorSpace.html#t:InnerSpace">InnerSpace</a> v) => <a href="file:///usr/share/doc/libghc-fingertree-doc/html/Data-FingerTree.html#t:Measured">Measured</a> (<a href="Diagrams-Segment.html#t:SegMeasure">SegMeasure</a> v) (<a href="Diagrams-Segment.html#t:Segment">Segment</a> <a href="Diagrams-Segment.html#t:Closed">Closed</a> v)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:oeOffset" class="def">oeOffset</a> :: <span class="keyword">forall</span> v. <a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="Diagrams-Segment.html#t:OffsetEnvelope">OffsetEnvelope</a> v) (<a href="Diagrams-Segment.html#t:TotalOffset">TotalOffset</a> v)<a href="src/Diagrams-Segment.html#oeOffset" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:oeEnvelope" class="def">oeEnvelope</a> :: <span class="keyword">forall</span> v. <a href="file:///usr/share/doc/libghc-lens-doc/html/Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="Diagrams-Segment.html#t:OffsetEnvelope">OffsetEnvelope</a> v) (<a href="Diagrams-Envelope.html#t:Envelope">Envelope</a> v)<a href="src/Diagrams-Segment.html#oeEnvelope" class="link">Source</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:SegMeasure" class="def">SegMeasure</a> v = <a href="Diagrams-Segment.html#t:SegCount">SegCount</a> <a href="file:///usr/share/doc/libghc-monoid-extras-doc/html/Data-Monoid-MList.html#t::::">:::</a> (<a href="Diagrams-Segment.html#t:ArcLength">ArcLength</a> v <a href="file:///usr/share/doc/libghc-monoid-extras-doc/html/Data-Monoid-MList.html#t::::">:::</a> (<a href="Diagrams-Segment.html#t:OffsetEnvelope">OffsetEnvelope</a> v <a href="file:///usr/share/doc/libghc-monoid-extras-doc/html/Data-Monoid-MList.html#t::::">:::</a> ()))<a href="src/Diagrams-Segment.html#SegMeasure" class="link">Source</a></p><div class="doc"><p><code>SegMeasure</code> collects up all the measurements over a chain of
segments.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|