[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Plane.java,1.1,1.2
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-08-26 14:49:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26875/src/net/sourceforge/bprocessor/model Modified Files: Plane.java Log Message: Implemented intersection Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Plane.java 25 Aug 2005 14:32:37 -0000 1.1 --- Plane.java 26 Aug 2005 14:49:23 -0000 1.2 *************** *** 44,55 **** /** ! * Find the intersection with the ray (x y t) * @param x the x * @param y the y ! * @return the intersection with the (x y t) ray */ double intersection(double x, double y) { ! ! return 0; } --- 44,60 ---- /** ! * Find the intersection with the ray (x y t), ! * if the ray is parallel to the Plane, otherwise NaN is ! * returned. The return value is the computed t. * @param x the x * @param y the y ! * @return the intersection with the (x y t) ray or NaN */ double intersection(double x, double y) { ! if (c != 0) { ! return -(a * x + b * y + d) / c; ! } else { ! return Double.NaN; ! } } |