pythagoras.f

## Class Ray3

• All Implemented Interfaces:
IRay3

```public class Ray3
extends Object
implements IRay3```
A ray consisting of an origin point and a unit direction vector.
• ### Field Summary

Fields
Modifier and Type Field and Description
`Vector3` `direction`
The ray's unit direction vector.
`Vector3` `origin`
The ray's point of origin.
• ### Constructor Summary

Constructors
Constructor and Description
`Ray3()`
Creates an empty (invalid) ray.
`Ray3(Ray3 other)`
Copy constructor.
```Ray3(Vector3 origin, Vector3 direction)```
Creates a ray with the values contained in the supplied origin point and unit direction vector.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Vector3` `direction()`
Returns a reference to the ray's unit direction vector.
`Vector3` `origin()`
Returns a reference to the ray's point of origin.
`Ray3` `set(Ray3 other)`
Copies the parameters of another ray.
`Ray3` ```set(Vector3 origin, Vector3 direction)```
Sets the ray parameters to the values contained in the supplied vectors.
`String` `toString()`
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
• ### Field Detail

• #### origin

`public final Vector3 origin`
The ray's point of origin.
• #### direction

`public final Vector3 direction`
The ray's unit direction vector.
• ### Constructor Detail

• #### Ray3

```public Ray3(Vector3 origin,
Vector3 direction)```
Creates a ray with the values contained in the supplied origin point and unit direction vector.
• #### Ray3

`public Ray3(Ray3 other)`
Copy constructor.
• #### Ray3

`public Ray3()`
Creates an empty (invalid) ray.
• ### Method Detail

• #### set

`public Ray3 set(Ray3 other)`
Copies the parameters of another ray.
Returns:
a reference to this ray, for chaining.
• #### set

```public Ray3 set(Vector3 origin,
Vector3 direction)```
Sets the ray parameters to the values contained in the supplied vectors.
Returns:
a reference to this ray, for chaining.
• #### origin

`public Vector3 origin()`
Description copied from interface: `IRay3`
Returns a reference to the ray's point of origin.
Specified by:
`origin` in interface `IRay3`
• #### direction

`public Vector3 direction()`
Description copied from interface: `IRay3`
Returns a reference to the ray's unit direction vector.
Specified by:
`direction` in interface `IRay3`
• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`