function(sin, cos, range, origin) {
    var stepX = this.step(sin, cos, origin.x, origin.y, false);
    var stepY = this.step(cos, sin, origin.y, origin.x, true);
    
    var inspectX = [sin, cos, stepX, 1, 0, origin.dist, stepX.y];
    var inspectY = [sin, cos, stepY, 0, 1, origin.dist, stepY.x];
    var next = this.inspect.apply(this, (stepX.len2 < stepY.len2) ? inspectX : inspectY);

    if (next.dist > range) {
      return [origin];
    }

    return [origin].concat(this.ray(sin, cos, range, next));
  }
function(sin, cos, range, origin) {
    var stepX = this.step(sin, cos, origin.x, origin.y, false);
    var stepY = this.step(cos, sin, origin.y, origin.x, true);
    
    var inspectX = [sin, cos, stepX, 1, 0, origin.dist, stepX.y];
    var inspectY = [sin, cos, stepY, 0, 1, origin.dist, stepY.x];
    var next = this.inspect.apply(this, (stepX.len2 < stepY.len2) ? inspectX : inspectY);

    if (next.dist > range) {
      return [origin];
    }

    return [origin].concat(this.ray(sin, cos, range, next));
  }
function ( sin , cos , range , origin ) { var stepX = this . step ( sin , cos , origin . x , origin . y , false ) ; var stepY = this . step ( cos , sin , origin . y , origin . x , true ) ; var inspectX = [ sin , cos , stepX , 1 , 0 , origin . dist , stepX . y ] ; var inspectY = [ sin , cos , stepY , 0 , 1 , origin . dist , stepY . x ] ; var next = this . inspect . apply ( this , ( stepX . len2 < stepY . len2 ) ? inspectX : inspectY ) ; if ( next . dist > range ) { return [ origin ] ; } return [ origin ] . concat ( this . ray ( sin , cos , range , next ) ) ; }
Emit a ray to beginb uilding the scene.
@param  {Number} sin    Sine of the cast angle.
@param  {Number} cos    Cosine of the cast angle.
@param  {Number} range  Max length of the ray.
@param  {Object} origin x, y, height and sitance
Emit a ray to beginb uilding the scene .
Returns a new array of rays of the given radius