Skip to content

Commit fd79b73

Browse files
committed
atan2: adjust wording a bit, fix formatting
Swapping "the x-axis" and the description of the vector makes the sentence a bit easier to understand, IMO. I think it's useful to mention that unary `atan2` is identical to `atan`. Also re-wrap atan2 section and remove trailing whitespace
1 parent 9de03a4 commit fd79b73

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

doc/Type/Cool.pod6

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,22 +288,26 @@ Defined as:
288288
sub atan2($y, $x = 1e0)
289289
method atan2($x = 1e0)
290290
291-
The sub should usually be written with two arguments for clarity as it is seen in other languages
292-
and in mathematical texts, but the single-argument form is available.
291+
The sub should usually be written with two arguments for clarity as it
292+
is seen in other languages and in mathematical texts, but the
293+
single-argument form is available; its result will always match that of
294+
L<atan|/routine/atan>.
293295
294296
say atan2 3, 1 # OUTPUT: «1.2490457723982544␤»
295-
say atan2 3 # OUTPUT: «1.2490457723982544␤»
297+
say atan2 3 # OUTPUT: «1.2490457723982544␤»
296298
say atan2 ⅔, ⅓ # OUTPUT: «1.1071487177940904␤»
297299
298-
The method coerces self and its single argument to L<Numeric|/type/Numeric>, using them to compute the
299-
two-argument L<arc-tangent|https://en.wikipedia.org/wiki/Atan2> in radians.
300+
The method coerces self and its single argument to
301+
L<Numeric|/type/Numeric>, using them to compute the two-argument
302+
L<arc-tangent|https://en.wikipedia.org/wiki/Atan2> in radians.
300303
301304
say 3.atan2; # OUTPUT: «1.24904577239825␤»
302305
say ⅔.atan2(⅓); # OUTPUT: «1.1071487177940904␤»
303306
304-
The $x argument in eiher the method or the sub defaults to 1 so, in both single-argument cases, the function will return
305-
the angle θ in radians between a vector that goes from the origin to the point (3, 1)
306-
and the x axis.
307+
The $x argument in eiher the method or the sub defaults to 1 so, in both
308+
single-argument cases, the function will return the angle θ in radians
309+
between the x-axis and a vector that goes from the origin to the point
310+
(3, 1).
307311
308312
=head2 routine sec
309313

0 commit comments

Comments
 (0)