returns the angle between two vectors *in degrees
| 260 | |
| 261 | // returns the angle between two vectors *in degrees* |
| 262 | static T angleBetween(const vec3<T> &v0, const vec3<T> &v1) { |
| 263 | T l0 = v0.length(); |
| 264 | T l1 = v1.length(); |
| 265 | if (l0 <= 0.0f || l1 <= 0.0f) |
| 266 | return 0.0f; |
| 267 | else |
| 268 | return acosf(std::clamp(vec3<T>::dot(v0, v1) / l0 / l1, -1.0f, 1.0f)) * 180.0f / M_PI; |
| 269 | } |
| 270 | |
| 271 | inline T *getData() { |
| 272 | return &array[0]; |