AP_Math: Vector2f::projected made const

This commit is contained in:
Randy Mackay 2023-06-27 13:09:13 +09:00
parent daf56c5ab1
commit 46702e6c49
2 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ void Vector2<T>::project(const Vector2<T> &v)
// returns this vector projected onto v // returns this vector projected onto v
template <typename T> template <typename T>
Vector2<T> Vector2<T>::projected(const Vector2<T> &v) Vector2<T> Vector2<T>::projected(const Vector2<T> &v) const
{ {
return v * (*this * v)/(v*v); return v * (*this * v)/(v*v);
} }

View File

@ -161,7 +161,7 @@ struct Vector2
void project(const Vector2<T> &v); void project(const Vector2<T> &v);
// returns this vector projected onto v // returns this vector projected onto v
Vector2<T> projected(const Vector2<T> &v); Vector2<T> projected(const Vector2<T> &v) const;
// adjust position by a given bearing (in degrees) and distance // adjust position by a given bearing (in degrees) and distance
void offset_bearing(T bearing, T distance); void offset_bearing(T bearing, T distance);