JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / src / javajs / util / P3.java
1 /*\r
2    Copyright (C) 1997,1998,1999\r
3    Kenji Hiranabe, Eiwa System Management, Inc.\r
4 \r
5    This program is free software.\r
6    Implemented by Kenji Hiranabe(hiranabe@esm.co.jp),\r
7    conforming to the Java(TM) 3D API specification by Sun Microsystems.\r
8 \r
9    Permission to use, copy, modify, distribute and sell this software\r
10    and its documentation for any purpose is hereby granted without fee,\r
11    provided that the above copyright notice appear in all copies and\r
12    that both that copyright notice and this permission notice appear\r
13    in supporting documentation. Kenji Hiranabe and Eiwa System Management,Inc.\r
14    makes no representations about the suitability of this software for any\r
15    purpose.  It is provided "AS IS" with NO WARRANTY.\r
16 */\r
17 package javajs.util;\r
18 \r
19 \r
20 \r
21 /**\r
22  * A 3 element point that is represented by single precision floating point\r
23  * x,y,z coordinates.\r
24  * \r
25  * @version specification 1.1, implementation $Revision: 1.10 $, $Date:\r
26  *          2006/09/08 20:20:20 $\r
27  * @author Kenji hiranabe\r
28  * \r
29  * additions by Bob Hanson hansonr@stolaf.edu 9/30/2012\r
30  * for unique constructor and method names\r
31  * for the optimization of compiled JavaScript using Java2Script\r
32  * \r
33  */\r
34 public class P3 extends T3 {\r
35 \r
36   /**\r
37    * @j2sIgnore\r
38    */\r
39   public P3() {\r
40     // ignore T3\r
41   }\r
42   \r
43   public static P3 newP(T3 t) {\r
44     P3 p = new P3();\r
45     p.x = t.x;\r
46     p.y = t.y;\r
47     p.z = t.z;\r
48     return p;\r
49   }\r
50 \r
51   private static P3 unlikely;\r
52   \r
53   public static P3 getUnlikely() {\r
54     return (unlikely == null ? unlikely = new3((float) Math.PI, (float) Math.E, (float) (Math.PI * Math.E)) : unlikely);\r
55   }\r
56   \r
57   public static P3 new3(float x, float y, float z) {\r
58     P3 p = new P3();\r
59     p.x = x;\r
60     p.y = y;\r
61     p.z = z;\r
62     return p;\r
63   }\r
64 \r
65 }\r