| 232 | |
| 233 | |
| 234 | int |
| 235 | Vector::Normalize(void) |
| 236 | { |
| 237 | double length = 0.0; |
| 238 | for (int i=0; i<sz; i++) |
| 239 | length += theData[i] * theData[i]; |
| 240 | length = sqrt(length); |
| 241 | |
| 242 | if (length == 0.0) |
| 243 | return -1; |
| 244 | |
| 245 | length = 1.0/length; |
| 246 | for (int j=0; j<sz; j++) |
| 247 | theData[j] *= length; |
| 248 | |
| 249 | return 0; |
| 250 | } |
| 251 | |
| 252 | int |
| 253 | Vector::addVector(double thisFact, const Vector &other, double otherFact ) |
no outgoing calls
no test coverage detected