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

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

Diagrams.TwoD.Segment

Contents

- Segment intersections
- Closest point on a segment
  - Low level functions

Description

Segments in two dimensions are special since we may meaningfully compute their point of intersection with a ray.

Synopsis

- intersectPointsS :: OrderedField n => FixedSegment V2 n -> FixedSegment V2 n -> [P2 n]
- intersectPointsS' :: OrderedField n => n -> FixedSegment V2 n -> FixedSegment V2 n -> [P2 n]
- closestPoint :: OrderedField n => FixedSegment V2 n -> P2 n -> [P2 n]
- closestPoint' :: OrderedField n => n -> FixedSegment V2 n -> P2 n -> [P2 n]
- closestDistance :: OrderedField n => FixedSegment V2 n -> P2 n -> [n]
- closestDistance' :: OrderedField n => n -> FixedSegment V2 n -> P2 n -> [n]
- closestParam :: OrderedField n => FixedSegment V2 n -> P2 n -> [n]
- closestParam' :: OrderedField n => n -> FixedSegment V2 n -> P2 n -> [n]
- segmentSegment :: OrderedField n => n -> FixedSegment V2 n -> FixedSegment V2 n -> [(n, n, P2 n)]
- lineSegment :: OrderedField n => n -> Located (V2 n) -> FixedSegment V2 n -> [(n, n, P2 n)]

# Segment intersections

intersectPointsS :: OrderedField n => FixedSegment V2 n -> FixedSegment V2 n -> [P2 n] Source

Compute the intersections between two fixed segments.

intersectPointsS' :: OrderedField n => n -> FixedSegment V2 n -> FixedSegment V2 n -> [P2 n] Source

Compute the intersections between two segments using the given tolerance.

# Closest point on a segment

closestPoint :: OrderedField n => FixedSegment V2 n -> P2 n -> [P2 n] Source

Get the closest point(s) on a `FixedSegment` from a point.

closestPoint' :: OrderedField n => n -> FixedSegment V2 n -> P2 n -> [P2 n] Source

Get the closest point(s) on a `FixedSegment` from a point within given tolerance.

closestDistance :: OrderedField n => FixedSegment V2 n -> P2 n -> [n] Source

Get the closest distance(s) from a point to a `FixedSegment`.

closestDistance' :: OrderedField n => n -> FixedSegment V2 n -> P2 n -> [n] Source

Get the closest distance(s) from a point to a `FixedSegment` within given tolerance.

closestParam :: OrderedField n => FixedSegment V2 n -> P2 n -> [n] Source

Find the closest value(s) on the Bêzier to the given point.

closestParam' :: OrderedField n => n -> FixedSegment V2 n -> P2 n -> [n] Source

Find the closest value(s) on the Bêzier to the given point within given tolerance.

## Low level functions

segmentSegment :: OrderedField n => n -> FixedSegment V2 n -> FixedSegment V2 n -> [(n, n, P2 n)] Source

Return the intersection points with the parameters at which each segment intersects.

lineSegment :: OrderedField n => n -> Located (V2 n) -> FixedSegment V2 n -> [(n, n, P2 n)] Source

Return the intersection points with the parameters at which the line and segment intersect.