gloss-1.1.1.0: Painless 2D vector graphics, animations and simulations.

Graphics.Gloss.Geometry.Line

Description

Geometric functions concerning lines.

Synopsis

# Documentation

Arguments

 :: Point `P1` -> Point `P2` -> Point `P3` -> Point the point on the line P1-P2 that is closest to `P3`

Given an infinite line which intersects `P1` and `P1`, return the point on that line that is closest to `P3`

Arguments

 :: Point `P1` -> Point `P2` -> Point `P3` -> Float

Given an infinite line which intersects P1 and P2, let P4 be the point on the line that is closest to P3.

Return an indication of where on the line P4 is relative to P1 and P2.

```      if P4 == P1 then 0
if P4 == P2 then 1
if P4 is halfway between P1 and P2 then 0.5
```
```        |
P1
|
P4 +---- P3
|
P2
|
```

Arguments

 :: Point P1 First point of segment. -> Point P2 Second point of segment. -> Float (y3) y value of horizontal segment. -> Float (xa) Leftmost x value of horizontal segment. -> Float (xb) Rightmost x value of horizontal segment. -> Maybe Point (x3, y3) Intersection point, if any.

Check if an arbitrary segment intersects a horizontal segment.

```                 P2
/
(xa, y3) ---+---- (xb, y3)
/
/
P1
```

Arguments

 :: Point P1 First point of segment. -> Point P2 Second point of segment. -> Float (x3) x value of vertical segment -> Float (ya) Lowest y value of vertical segment. -> Float (yb) Highest y value of vertical segment. -> Maybe Point (x3, y3) Intersection point, if any.

Check if an arbitrary segment intersects a vertical segment.

```         (x3, yb)
|   P1
| /
+
/ |
P2   |
(x3, ya)
```