MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / angle

Method angle

libraries/AP_Math/vector3.cpp:425–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423
424template <typename T>
425T Vector3<T>::angle(const Vector3<T> &v2) const
426{
427 const T len = this->length() * v2.length();
428 if (len <= 0) {
429 return 0.0f;
430 }
431 const T cosv = ((*this)*v2) / len;
432 if (cosv >= 1 || cosv <= -1) {
433 return 0.0f;
434 }
435 return acosF(cosv);
436}
437
438// multiplication of transpose by a vector
439template <typename T>

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.95

Tested by

no test coverage detected