2 Copyright (C) 1997,1998,1999
3 Kenji Hiranabe, Eiwa System Management, Inc.
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.
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.
22 * A 4 element point that is represented by single precision floating point
23 * x,y,z,w coordinates.
25 * @version specification 1.1, implementation $Revision: 1.9 $, $Date:
26 * 2006/07/28 17:01:32 $
27 * @author Kenji hiranabe
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
33 public class P4 extends T4 {
36 // skip T4() constructor
39 public static P4 new4(float x, float y, float z, float w) {
45 public static P4 newPt(P4 value) {
47 pt.set4(value.x, value.y, value.z, value.w);
52 * Returns the distance between this point and point p1.
56 * @return the distance between these two points
58 public final float distance4(P4 p1) {
63 return (float) Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);