1 package org.lcsim.spacegeom;
2
3 import static java.lang.Math.sqrt;
4 import static org.lcsim.spacegeom.Representation.Cartesian;
5
6
7
8
9 public class CartesianVector extends SpaceVector
10 {
11
12
13
14
15 public CartesianVector(double[] x) {
16 this(x[0], x[1], x[2]);
17 }
18
19
20
21
22
23
24 public CartesianVector(double x, double y, double z)
25 {
26 _x = x;
27 _y = y;
28 _z = z;
29 _representation = Cartesian;
30 _phi = Double.NaN;
31 _theta = Double.NaN;
32 _xy = Double.NaN;
33 _xyz = sqrt(_x*_x + _y*_y + _z*_z);
34 }
35 }