From 46702e6c4950c014c57900429950ad6b3855f7d4 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 27 Jun 2023 13:09:13 +0900 Subject: [PATCH] AP_Math: Vector2f::projected made const --- libraries/AP_Math/vector2.cpp | 2 +- libraries/AP_Math/vector2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Math/vector2.cpp b/libraries/AP_Math/vector2.cpp index a04fe80f8d..0204e8d3af 100644 --- a/libraries/AP_Math/vector2.cpp +++ b/libraries/AP_Math/vector2.cpp @@ -295,7 +295,7 @@ void Vector2::project(const Vector2 &v) // returns this vector projected onto v template -Vector2 Vector2::projected(const Vector2 &v) +Vector2 Vector2::projected(const Vector2 &v) const { return v * (*this * v)/(v*v); } diff --git a/libraries/AP_Math/vector2.h b/libraries/AP_Math/vector2.h index 152da15989..fd57b91454 100644 --- a/libraries/AP_Math/vector2.h +++ b/libraries/AP_Math/vector2.h @@ -161,7 +161,7 @@ struct Vector2 void project(const Vector2 &v); // returns this vector projected onto v - Vector2 projected(const Vector2 &v); + Vector2 projected(const Vector2 &v) const; // adjust position by a given bearing (in degrees) and distance void offset_bearing(T bearing, T distance);