58 : theArray(right.theArray)
80 if (right.size() != 3)
82 GNSSTK_THROW(GeometryException(
"Incorrect vector size"));
93 for(
int i=0;i<3;i++) toReturn(i) =
theArray[i];
101 std::vector<double> toReturn;
102 for(
int i=0;i<3;i++) toReturn.push_back(
theArray[i]);
111 z = (this->theArray)*(right.theArray);
122 cp[0] = (*this)[1] * right[2] - (*this)[2] * right[1];
123 cp[1] = (*this)[2] * right[0] - (*this)[0] * right[2];
124 cp[2] = (*this)[0] * right[1] - (*this)[1] * right[0];
131 return std::sqrt(
dot(*
this));
136 double mag = std::sqrt(
dot(*
this));
139 GNSSTK_THROW(GeometryException(
"Divide by Zero Error"));
142 retArg[0] = (*this)[0] /
mag;
143 retArg[1] = (*this)[1] /
mag;
144 retArg[2] = (*this)[2] /
mag;
151 double rx, ry, cosvects;
154 ry = right.
dot(right);
156 if (rx <= 1e-14 || ry <= 1e-14)
158 GNSSTK_THROW(GeometryException(
"Divide by Zero Error"));
160 cosvects =
dot(right) / ::sqrt(rx * ry);
163 if (fabs(cosvects) > 1.0e0)
165 cosvects = fabs(cosvects) / cosvects;
177 z = right.
theArray - this->theArray;
197 double xy, xyz, cosl, sinl, sint, xn1, xn2, xn3, xe1, xe2;
198 double z1, z2, z3, p1, p2, test, alpha;
200 xy = (*this)[0] * (*this)[0] + (*this)[1] * (*this)[1] ;
201 xyz = xy + (*this)[2] * (*this)[2] ;
205 if (xy <= 1e-14 || xyz <=1e-14)
208 cosl = (*this)[0] / xy;
209 sinl = (*this)[1] / xy;
210 sint = (*this)[2] / xyz;
219 z1 = right[0] - (*this)[0];
220 z2 = right[1] - (*this)[1];
221 z3 = right[2] - (*this)[2];
223 p1 = (xn1 * z1) + (xn2 * z2) + (xn3 * z3) ;
224 p2 = (xe1 * z1) + (xe2 * z2) ;
226 test = fabs(p1) + fabs(p2);
230 GNSSTK_THROW(GeometryException(
"azAngle(), failed p1+p2 test."));
257 rot[1] = cosangle*(*this)[1] + sinangle*(*this)[2];
258 rot[2] = -sinangle*(*this)[1] + cosangle*(*this)[2];
274 rot[0] = cosangle*(*this)[0] - sinangle*(*this)[2];
276 rot[2] = sinangle*(*this)[0] + cosangle*(*this)[2];
292 rot[0] = cosangle*(*this)[0] + sinangle*(*this)[1];
293 rot[1] = -sinangle*(*this)[0] + cosangle*(*this)[1];
301 return (*
this)[0]==right[0] && (*this)[1]==right[1] && (*this)[2]==right[2];
331 for (
size_t i = 1; i < v.size(); i++)