Fixed issues with compilation.
[IRC.git] / Robust / src / Benchmarks / Scheduling / GC / NON_BAMBOO / RayTracer / Ray.java
1 package RayTracer;
2
3 /**************************************************************************
4  *                                                                         *
5  *             Java Grande Forum Benchmark Suite - Version 2.0             *
6  *                                                                         *
7  *                            produced by                                  *
8  *                                                                         *
9  *                  Java Grande Benchmarking Project                       *
10  *                                                                         *
11  *                                at                                       *
12  *                                                                         *
13  *                Edinburgh Parallel Computing Centre                      *
14  *                                                                         *
15  *                email: epcc-javagrande@epcc.ed.ac.uk                     *
16  *                                                                         *
17  *                 Original version of this code by                        *
18  *            Florian Doyon (Florian.Doyon@sophia.inria.fr)                *
19  *              and  Wilfried Klauser (wklauser@acm.org)                   *
20  *                                                                         *
21  *      This version copyright (c) The University of Edinburgh, 1999.      *
22  *                         All rights reserved.                            *
23  *                                                                         *
24  **************************************************************************/
25
26
27
28 final public class Ray {
29   public Vec P, D;
30
31   public Ray(Vec pnt, Vec dir) {
32     P = new Vec(pnt.x, pnt.y, pnt.z);
33     D = new Vec(dir.x, dir.y, dir.z);
34     D.normalize();
35   }
36
37   public Ray() {
38     P = new Vec();
39     D = new Vec();
40   }
41
42   public Vec point(float t) {
43     return new Vec(P.x + D.x * t, P.y + D.y * t, P.z + D.z * t);
44   }
45
46   public String toString() {
47     return "{" + P.toString() + " -> " + D.toString() + "}";
48   }
49 }