Skip to content

Commit f382a2b

Browse files
authored
Merge pull request godotengine#70509 from irwiss/reverse-Vector2.AngleToPoint
C#: reverse Vector2.AngleToPoint
2 parents 9f1fe08 + e9ace71 commit f382a2b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public readonly real_t AngleTo(Vector2 to)
139139
/// <returns>The angle between the two vectors, in radians.</returns>
140140
public readonly real_t AngleToPoint(Vector2 to)
141141
{
142-
return Mathf.Atan2(y - to.y, x - to.x);
142+
return Mathf.Atan2(to.y - y, to.x - x);
143143
}
144144

145145
/// <summary>

modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public readonly real_t AngleTo(Vector2i to)
123123
/// <returns>The angle between the two vectors, in radians.</returns>
124124
public readonly real_t AngleToPoint(Vector2i to)
125125
{
126-
return Mathf.Atan2(y - to.y, x - to.x);
126+
return Mathf.Atan2(to.y - y, to.x - x);
127127
}
128128

129129
/// <summary>

0 commit comments

Comments
 (0)