pythagoras.d

## Interface IRay2

• All Known Implementing Classes:
Ray2

`public interface IRay2`
Provides read-only access to a `Ray2`.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`IVector` `direction()`
Returns a reference to the ray's unit direction vector.
`boolean` ```getIntersection(IVector center, double radius, Vector result)```
Finds the intersection between the ray and a circle with the given center and radius.
`boolean` ```getIntersection(IVector start, IVector end, double radius, Vector result)```
Finds the intersection between the ray and a capsule with the given start point, end point, and radius.
`boolean` ```getIntersection(IVector start, IVector end, Vector result)```
Finds the intersection between the ray and a line segment with the given start and end points.
`Vector` ```getNearestPoint(IVector point, Vector result)```
Computes the nearest point on the Ray to the supplied point.
`boolean` `intersects(IVector pt)`
Determines whether the ray intersects the specified point.
`IVector` `origin()`
Returns a reference to the ray's point of origin.
`Ray2` `transform(Transform transform)`
Transforms this ray.
`Ray2` ```transform(Transform transform, Ray2 result)```
Transforms this ray, placing the result in the object provided.
• ### Method Detail

• #### origin

`IVector origin()`
Returns a reference to the ray's point of origin.
• #### direction

`IVector direction()`
Returns a reference to the ray's unit direction vector.
• #### transform

`Ray2 transform(Transform transform)`
Transforms this ray.
Returns:
a new ray containing the result.
• #### transform

```Ray2 transform(Transform transform,
Ray2 result)```
Transforms this ray, placing the result in the object provided.
Returns:
a reference to the result ray, for chaining.
• #### intersects

`boolean intersects(IVector pt)`
Determines whether the ray intersects the specified point.
• #### getIntersection

```boolean getIntersection(IVector start,
IVector end,
Vector result)```
Finds the intersection between the ray and a line segment with the given start and end points.
Returns:
true if the ray intersected the segment (in which case the result will contain the point of intersection), false otherwise.
• #### getIntersection

```boolean getIntersection(IVector start,
IVector end,
Vector result)```
Finds the intersection between the ray and a capsule with the given start point, end point, and radius.
Returns:
true if the ray intersected the circle (in which case the result will contain the point of intersection), false otherwise.
• #### getIntersection

```boolean getIntersection(IVector center,
```Vector getNearestPoint(IVector point,
`result` for chaining.