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