Ray2¶
Under Construction
This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/dot/blob/main/js/Ray2.ts for the most up-to-date information.
Overview¶
2-dimensional ray consisting of an origin point and a unit direction vector.
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class Ray2¶
Constructor¶
new Ray2( position : Vector2, direction : Vector2 )¶
Instance Methods¶
shifted( distance : number ) : Ray2¶
Returns a new Ray that has it origin shifted to a position given by an amount distance*this.direction.
pointAtDistance( distance : number ) : Vector2¶
Returns a position that is a distance 'distance' along the ray.
toString() : string¶
Returns the attributes of this ray into a string