Skip to content

Commit f88e108

Browse files
Improve documentation for Vector2's angle-related methods
1 parent 2cb2c1f commit f88e108

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

doc/classes/Vector2.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,31 @@
5959
<description>
6060
Returns this vector's angle with respect to the positive X axis, or [code](1, 0)[/code] vector, in radians.
6161
For example, [code]Vector2.RIGHT.angle()[/code] will return zero, [code]Vector2.DOWN.angle()[/code] will return [code]PI / 2[/code] (a quarter turn, or 90 degrees), and [code]Vector2(1, -1).angle()[/code] will return [code]-PI / 4[/code] (a negative eighth turn, or -45 degrees).
62+
This is equivalent to calling [method @GlobalScope.atan2] with [member y] and [member x].
6263
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle.png]Illustration of the returned angle.[/url]
63-
Equivalent to the result of [method @GlobalScope.atan2] when called with the vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code].
6464
</description>
6565
</method>
6666
<method name="angle_to" qualifiers="const">
6767
<return type="float" />
6868
<param index="0" name="to" type="Vector2" />
6969
<description>
70-
Returns the signed angle to the given vector, in radians.
70+
Returns the signed angle to the given vector, in radians. The result ranges from [code]-PI[/code] to [code]PI[/code] (inclusive).
7171
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle_to.png]Illustration of the returned angle.[/url]
7272
</description>
7373
</method>
7474
<method name="angle_to_point" qualifiers="const">
7575
<return type="float" />
7676
<param index="0" name="to" type="Vector2" />
7777
<description>
78-
Returns the angle between the line connecting the two points and the X axis, in radians.
79-
[code]a.angle_to_point(b)[/code] is equivalent of doing [code](b - a).angle()[/code].
78+
Returns the signed angle between the X axis and the line from this vector to point [param to], in radians. The result ranges from [code]-PI[/code] to [code]PI[/code] (inclusive).
79+
[code]a.angle_to_point(b)[/code] is equivalent to [code](b - a).angle()[/code]. See also [method angle].
8080
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle_to_point.png]Illustration of the returned angle.[/url]
8181
</description>
8282
</method>
8383
<method name="aspect" qualifiers="const">
8484
<return type="float" />
8585
<description>
86-
Returns the aspect ratio of this vector, the ratio of [member x] to [member y].
86+
Returns this vector's aspect ratio, which is [member x] divided by [member y].
8787
</description>
8888
</method>
8989
<method name="bezier_derivative" qualifiers="const">
@@ -173,7 +173,8 @@
173173
<return type="Vector2" />
174174
<param index="0" name="to" type="Vector2" />
175175
<description>
176-
Returns the normalized vector pointing from this vector to [param to]. This is equivalent to using [code](b - a).normalized()[/code].
176+
Returns the normalized vector pointing from this vector to [param to].
177+
[code]a.direction_to(b)[/code] is equivalent to [code](b - a).normalized()[/code]. See also [method normalized].
177178
</description>
178179
</method>
179180
<method name="distance_squared_to" qualifiers="const">

0 commit comments

Comments
 (0)