65 EGS_Vector(EGS_Float xx, EGS_Float yy, EGS_Float zz) : x(xx), y(yy), z(zz) {};
102 EGS_Vector operator*(
const EGS_Float f)
const {
114 EGS_Float operator*(
const EGS_Vector &v)
const {
115 return x*v.
x + y*v.
y + z*v.
z;
137 EGS_Float length()
const {
138 return sqrt(x*x+y*y+z*z);
140 EGS_Float length2()
const {
144 EGS_Float tmp = 1./length();
150 void rotate(EGS_Float cos_t, EGS_Float sin_t,
151 EGS_Float c_phi, EGS_Float s_phi) {
152 EGS_Float sin_z = x*x + y*y;
155 EGS_Float temp = sin_t/sin_z;
156 EGS_Float temp_phi = z*c_phi;
157 EGS_Float temp_x = x*cos_t;
158 register EGS_Float temp_y = y*cos_t;
159 EGS_Float temp_x1 = temp_phi*x-y*s_phi;
160 EGS_Float temp_y1 = temp_phi*y+x*s_phi;
161 x = temp*temp_x1+temp_x;
162 y = temp*temp_y1+temp_y;
163 z = z*cos_t-sin_z*sin_t*c_phi;
A class representing 3D vectors.
Global egspp functions header file.
Defines the EGS_EXPORT and EGS_LOCAL macros.
#define EGS_EXPORT
Export symbols from the egspp library.
Attempts to fix broken math header files.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.