Ray - Cesium Documentation

# Ray

#### new Ray(origin, direction)

  Represents a ray that extends infinitely from the provided origin in the provided direction.

  Name | Type | Default | Description
  --- | --- | --- | ---
  `origin` | Cartesian3 | `Cartesian3.ZERO` | optional The origin of the ray.
  `direction` | Cartesian3 | `Cartesian3.ZERO` | optional The direction of the ray.

  Source: Core/Ray.js, line 22

### Members

#### direction :Cartesian3

  The direction of the ray.
  Source: Core/Ray.js, line 39

#### origin :Cartesian3

  The origin of the ray.
  Default Value: ``Cartesian3.ZERO``
  Source: Core/Ray.js, line 33

### Methods

#### staticRay.getPoint(t, result)

  Computes the point along the ray given by r(t) = o + t*d, where o is the origin of the ray and d is the direction.

  Name | Type | Description
  --- | --- | ---
  `t` | Number | A scalar value.
  `result` | Cartesian3 | optional The object in which the result will be stored.

  ##### Returns:

  The modified result parameter, or a new instance if none was provided.

  ##### Example:

      //Get the first intersection point of a ray and an ellipsoid.
      var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
      var point = Cesium.Ray.getPoint(ray, intersection.start);

  Source: Core/Ray.js, line 55