{"size": 1145, "ext": "scrbl", "max_stars_repo_path": "plane/ray.scrbl", "max_stars_repo_name": "jackfirth/euclid", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "plane/ray.scrbl", "max_issues_repo_name": "jackfirth/euclid", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "plane/ray.scrbl", "max_forks_repo_name": "jackfirth/euclid", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.2619047619, "max_line_length": 100, "alphanum_fraction": 0.6253275109}
#lang scribble/manual


@(require (for-label euclid/plane/angle
                     euclid/plane/point
                     euclid/plane/ray
                     racket/base
                     racket/contract/base)
          (submod euclid/private/scribble-evaluator-factory doc)
          scribble/example)


@(define make-evaluator
   (make-module-sharing-evaluator-factory
    #:public (list 'euclid/plane/point
                   'euclid/plane/ray)
    #:private (list 'racket/base)))


@title{2D Rays}
@defmodule[euclid/plane/ray]


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


@defstruct*[ray
            ([initial-point point?]
             [direction angle?])
            #:transparent]{
 A @tech{2D ray} structure starting at @racket[initial-point] and pointed in @racket[direction].}


@defproc[(ray-between [initial point?] [target point?]) ray?]{
 Returns the ray starting at @racket[initial] and pointed towards @racket[target].

 @(examples
   #:eval (make-evaluator)
   (ray-between (point 1 1) (point 5 5))
   (ray-between (point 4 8) (point 4 0)))}
