Source code: rcs/posemath/PmCartesian.java
1 /*
2 * New Java File starts here.
3 * This file should be named PmCartesian.java
4 */
5
6
7 // Set Package Name
8 package rcs.posemath;
9
10 // Import all NML, CMS, and RCS classes and interfaces
11 import rcs.*;
12 import rcs.nml.*;
13 import rcs.utils.*;
14
15 /*
16 * Class definition for PmCartesian
17 * Automatically generated by RCS Java Diagnostics Tool.
18 * on Wed Jan 07 10:53:46 EST 1998
19 */
20 public class PmCartesian implements Cloneable
21 {
22 public double x = 0;
23 public double y = 0;
24 public double z = 0;
25
26 public void update(NMLFormatConverter nml_fc)
27 {
28 x = nml_fc.update(x);
29 y = nml_fc.update(y);
30 z = nml_fc.update(z);
31
32 }
33
34 public PmCartesian()
35 {
36 x = 0;
37 y = 0;
38 z = 0;
39 }
40
41 public PmCartesian(double startx, double starty, double startz)
42 {
43 x = startx;
44 y = starty;
45 z = startz;
46 }
47
48 public boolean equals(PmCartesian v) throws PmException
49 {
50 if(null == v)
51 {
52 return false;
53 }
54 return Posemath.pmCartCartCompare(this,v);
55 }
56
57 public boolean equals(PmCylindrical c) throws PmException
58 {
59 if(null == c)
60 {
61 return false;
62 }
63 PmCartesian v = new PmCartesian();
64 Posemath.pmCylCartConvert(c,v);
65 return Posemath.pmCartCartCompare(this,v);
66 }
67
68 public boolean equals(PmSpherical s) throws PmException
69 {
70 if(null == s)
71 {
72 return false;
73 }
74 PmCartesian v = new PmCartesian();
75 Posemath.pmSphCartConvert(s,v);
76 return Posemath.pmCartCartCompare(this,v);
77 }
78
79 public String toString()
80 {
81 return " { x ="+x+", y = "+y+", z = "+z+" } ";
82 }
83
84
85
86 }
87