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

Diagrams.TwoD.Segment

Description

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

Synopsis

# 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.

# Orphan instances

 Source # Instance details MethodsgetTrace :: FixedSegment V2 n -> Trace (V (FixedSegment V2 n)) (N (FixedSegment V2 n)) # Source # Instance details MethodsgetTrace :: Segment Closed V2 n -> Trace (V (Segment Closed V2 n)) (N (Segment Closed V2 n)) #