Ray2d Class
Ray with xy origin and direction
Methods
| Name | Description | |
|---|---|---|
| ccwPerpendicularRay(result?: Ray2d): Ray2d | Return a ray with cloned origin and with direction rotated 90 degrees counterclockwise | |
| cwPerpendicularRay(result?: Ray2d): Ray2d | Return a ray with cloned origin and with direction rotated 90 degrees clockwise | |
| fractionToPoint(f: number, result?: Point2d): Point2d | Compute and return origin plus scaled direction. | |
| intersectUnboundedLine(linePointA: Point2d, linePointB: Point2d): { cross: number, fraction: number, hasIntersection: boolean } | Intersect this ray with the unbounded line defined by the given points. | |
| normalizeDirectionInPlace(defaultX: number1, defaultY: number0): boolean | Normalize the direction vector in place. | |
| parallelRay(leftFraction: number, result?: Ray2d): Ray2d | Return a parallel ray to the left of this ray. | |
| perpendicularProjectionFraction(point: Point2d): number | Return the ray fraction where the given point projects onto the perpendicular ray. | |
| projectionFraction(point: Point2d): number | Return the ray fraction where the given point projects onto the ray. | |
| set(origin: Point2d, direction: Vector2d): void | Copy coordinates from origin and direction. | |
| createOriginAndDirection(origin: Point2d, direction: Vector2d, result?: Ray2d): Ray2d Static | Create by copying coordinates from originanddirection. | |
| createOriginAndDirectionCapture(origin: Point2d, direction: Vector2d, result?: Ray2d): Ray2d Static | Create from captured originanddirection. | |
| createOriginAndTarget(origin: Point2d, target: Point2d, result?: Ray2d): Ray2d Static | Create from originandtargetpoints. | 
Properties
| Name | Type | Description | |
|---|---|---|---|
| direction Accessor ReadOnly | Vector2d | Get the reference to the ray direction. | |
| origin Accessor ReadOnly | Point2d | Get the reference to the ray origin. | 
Defined in
- geometry3d/Ray2d.ts Line 19
Last Updated: 24 June, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.