mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added a function to multiply a point by a scalar, and improved the comments for Point::getAngleToPoint()
This commit is contained in:
parent
dd576a5192
commit
df33097ddf
1 changed files with 8 additions and 2 deletions
|
|
@ -155,8 +155,10 @@ public:
|
|||
|
||||
/** Returns the angle from this point to another one.
|
||||
|
||||
The return value is the number of radians clockwise from the 12 o'clock direction,
|
||||
where this point is the centre and the other point is on the circumference.
|
||||
Taking this point to be the centre of a circle, and the other point being a position on
|
||||
the circumference, the return value is the number of radians clockwise from the 12 o'clock
|
||||
direction.
|
||||
So 12 o'clock = 0, 3 o'clock = Pi/2, 6 o'clock = Pi, 9 o'clock = -Pi/2
|
||||
*/
|
||||
FloatType getAngleToPoint (Point other) const noexcept
|
||||
{
|
||||
|
|
@ -233,5 +235,9 @@ public:
|
|||
ValueType y; /**< The point's Y coordinate. */
|
||||
};
|
||||
|
||||
/** Multiplies the point's coordinates by a scalar value. */
|
||||
template <typename ValueType>
|
||||
Point<ValueType> operator* (ValueType value, Point<ValueType> p) noexcept { return p * value; }
|
||||
|
||||
|
||||
#endif // JUCE_POINT_H_INCLUDED
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue