# Ray

Class representing a ray.

## Constructor

#### new Ray(pt, norm)

Ray may be constructed by setting start point and a normal vector Ray goes to the right direction with respect to the normal vector If normal vector is omitted ray is considered horizontal (normal vector is (0,1)) If started point is omitted, ray is started at zero point

Source:
  - classes/ray.js, line 19

##### Parameters:

Name | Type | Description
--- | --- | ---
`pt` | `Point` | start point
`norm` | `Vector` | normal vector

### Classes

Ray

### Members

#### slope

Slope of the ray - angle in radians between ray and axe x from 0 to 2PI

Source:
  - classes/ray.js, line 60

#### box

Returns half-infinite bounding box of the ray

Source:
  - classes/ray.js, line 69

#### start

Return ray start point

Source:
  - classes/ray.js, line 83

#### end

Ray has no end point?

Source:
  - classes/ray.js, line 91

#### length

Return positive infinity number as length

Source:
  - classes/ray.js, line 97

### Methods

#### clone() → {Ray}

Return new cloned instance of ray

Source:
  - classes/ray.js, line 52

##### Returns:

Type:
  `Ray`

#### contains(pt) → {boolean}

Returns true if point belongs to ray

Source:
  - classes/ray.js, line 104

##### Parameters:

Name | Type | Description
--- | --- | ---
`pt` | `Point` | Query point

##### Returns:

Type:
  `boolean`

#### split(pt)

Split ray with point and return array of segment and new ray

Source:
  - classes/ray.js, line 119

##### Parameters:

Name | Type | Description
--- | --- | ---
`pt` | `Point` |

##### Returns:

[Segment,Ray]

#### intersect(shape) → {Array}

Returns array of intersection points between ray and segment or arc

Source:
  - classes/ray.js, line 138

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape` | `Segment` | `Arc` | Shape to intersect with ray

##### Returns:

Type:
  `Array`

array of intersection points

#### svg(box, attrs)

Return string to draw svg segment representing ray inside given box

Source:
  - classes/ray.js, line 199

##### Parameters:

Name | Type | Description
--- | --- | ---
`box` | `Box` | Box representing drawing area
`attrs` | `Object` | an object with attributes of svg segment element