On this page:
ray
ray-between
8.12

1.3 2D Rays🔗ℹ

 (require euclid/plane/ray) package: euclid

A 2D ray is half of a line. A ray starts at an initial point and continues infinitely in a single direction.

struct

(struct ray (initial-point direction)
    #:transparent)
  initial-point : point?
  direction : angle?
A 2D ray structure starting at initial-point and pointed in direction.

procedure

(ray-between initial target)  ray?

  initial : point?
  target : point?
Returns the ray starting at initial and pointed towards target.

Examples:
> (ray-between (point 1 1) (point 5 5))

(ray (1,1) 45°)

> (ray-between (point 4 8) (point 4 0))

(ray (4,8) 270°)