1 package org.lcsim.spacegeom; 2 /** A differential path element vector ds in Cartesian, 3 * cylindrical or spherical coordinates. It is constructed using a 4 * subclass and then elements can be fetched for any of these coordinate 5 * systems. The stored vector can also include scalar quantities. 6 * Typical applications include velocity ds/dt and direction ds/d|s|. 7 *<p> 8 * Transformations (translations, rotations, etc) are not provided. 9 * It is expected these will be carried out by external functions which 10 * return new SpacePath objects. 11 * 12 *<p> 13 * Three orthogonal coordinate systems are: 14 *<ul> 15 *<li> Cartesian: (x, y, z) 16 *<li> Cylindrical: (rxy, phi, z) 17 *<li> Spherical: (rxyz, theta, phi) . 18 *</ul> 19 * These coordinates may be obtained via the space point interface. 20 * 21 *<p> 22 * The corresponding path element vectors are: 23 *<ul> 24 *<li> Cartesian: (dx, dy, dz) 25 *<li> Cylindrical: (drxy, rxy*dphi, dz) 26 *<li> Spherical: (drxyz, rxyz*dtheta, rxy*dphi) . 27 *</ul> 28 * These elements may be accessed via the usual space vector interface 29 * (v_x(), v_y(), ...) or via the methods defined here. 30 *<p> 31 *@author Norman A. Graf 32 *@version $Id: SpacePath.java,v 1.1.1.1 2010/12/01 00:15:57 jeremy Exp $ 33 *@deprecated this class does not offer additional functionality to SpacePointVector 34 * 35 */ 36 @Deprecated public class SpacePath extends SpacePointVector 37 { 38 39 // methods 40 41 /** Default constructor. 42 * 43 */ 44 public SpacePath( ) 45 { 46 super(); 47 } 48 49 /** Constructor from a space vector. 50 * @param svec the SpacePointVector from which to contruct 51 */ 52 public SpacePath( SpacePointVector svec ) 53 { 54 super(svec); 55 } 56 57 58 /** Cartesian dx. 59 * @return delta x 60 */ 61 public double dx( ) 62 { 63 return v_x(); 64 } 65 66 /** Cartesian dy. 67 * @return delta y 68 */ 69 public double dy( ) 70 { 71 return v_y(); 72 } 73 74 /** Cartesian or cylindrical dz. 75 * @return Cartesian or cylindrical dz. 76 */ 77 public double dz( ) 78 { 79 return v_z(); 80 } 81 82 /** Cylindrical drxy. 83 * Can be well defined at rxy=0. 84 * @return Cylindrical dradius 85 */ 86 public double drxy( ) 87 { 88 return v_rxy(); 89 } 90 91 /** Cylindrical or spherical rxy*dphi. 92 * Can be well defined at rxy=0. 93 * @return radius*dphi (2d radius) 94 */ 95 public double rxy_dphi( ) 96 { 97 return v_phi(); 98 } 99 100 /** Cylindrical or spherical dphi. 101 * Not well defined at rxy=0. 102 * @return dphi (not well defined at r=0) 103 */ 104 public double dphi( ) 105 { 106 return v_phi()/v_rxy(); 107 } 108 109 /** Spherical rxyz. 110 * Can be well defined at rxyz=0. 111 * @return spherical radius 112 */ 113 public double drxyz( ) 114 { return v_rxyz(); } 115 116 /** Spherical rxyz*dtheta. 117 * Can be well defined at rxyz=0. 118 * @return spherical radius*dtheta 119 */ 120 public double rxyz_dtheta( ) 121 { 122 return v_theta(); 123 } 124 125 /** Spherical dtheta. 126 * Not well defined at rxyz=0; 127 * @return Spherical dtheta. 128 */ 129 public double dtheta( ) 130 { 131 return v_theta()/v_rxyz(); 132 } 133 134 135 /** Output stream 136 * 137 * 138 * @return String representation of the object 139 */ 140 public String toString() 141 { 142 return super.toString() 143 + "SpacePath: " + "\n" 144 + " dx: " + dx() + "\n" 145 + " dy: " + dy() + "\n" 146 + " dz: " + dz() + "\n" 147 + " drxy: " + drxy() + "\n" 148 + " drxyz: " + drxyz() + "\n" 149 + " rt*dphi: " + rxy_dphi() + "\n" 150 + " r*dtheta: " + rxyz_dtheta() + "\n" 151 + "Magnitude: " + magnitude() + "\n"; 152 } 153 154 } 155