ray.java

来自「MPI for java for Distributed Programming」· Java 代码 · 共 51 行

JAVA
51
字号
/***************************************************************************                                                                         **             Java Grande Forum Benchmark Suite - MPJ Version 1.0         **                                                                         **                            produced by                                  **                                                                         **                  Java Grande Benchmarking Project                       **                                                                         **                                at                                       **                                                                         **                Edinburgh Parallel Computing Centre                      **                                                                         **                email: epcc-javagrande@epcc.ed.ac.uk                     **                                                                         **                 Original version of this code by                        **            Florian Doyon (Florian.Doyon@sophia.inria.fr)                **              and  Wilfried Klauser (wklauser@acm.org)                   **                                                                         **      This version copyright (c) The University of Edinburgh, 2001.      **                         All rights reserved.                            **                                                                         ***************************************************************************/package jgf_mpj_benchmarks.section3.raytracer;//package raytracer; final public class Ray {	public Vec P, D;	public Ray(Vec pnt, Vec dir) {		P = new Vec(pnt.x, pnt.y, pnt.z);		D = new Vec(dir.x, dir.y, dir.z);		D.normalize();	}	public Ray() {		P = new Vec();		D = new Vec();	}	public Vec point(double t) {		return new Vec(P.x + D.x * t, P.y + D.y * t, P.z + D.z * t);	}	public String toString() {		return "{" + P.toString() + " -> " + D.toString() + "}";	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?