1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a method Point::dotProduct()

This commit is contained in:
jules 2013-03-23 11:09:30 +00:00
parent 7afc21cbab
commit 29419e480e

View file

@ -164,6 +164,9 @@ public:
{ return Point (transform.mat00 * x + transform.mat01 * y + transform.mat02,
transform.mat10 * x + transform.mat11 * y + transform.mat12); }
/** Returns the dot-product of two points (x1 * x2 + y1 * y2). */
FloatType getDotProduct (const Point& other) const noexcept { return x * other.x + y * other.y; }
/** Casts this point to a Point<int> object. */
Point<int> toInt() const noexcept { return Point<int> (static_cast <int> (x), static_cast<int> (y)); }