Skip to content

Commit 0e4de4a

Browse files
committed
Rollup merge of rust-lang#49254 - Tacklebox:atan2_doc, r=QuietMisdreavus
Fixed clockwise/counter-clockwise in atan2 documentation in f32 and f64 and included that it returns radians None
2 parents 1a890a6 + c116b0e commit 0e4de4a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/libstd/f32.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ impl f32 {
780780
unsafe { cmath::atanf(self) }
781781
}
782782

783-
/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`).
783+
/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
784784
///
785785
/// * `x = 0`, `y = 0`: `0`
786786
/// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]`
@@ -791,12 +791,13 @@ impl f32 {
791791
/// use std::f32;
792792
///
793793
/// let pi = f32::consts::PI;
794-
/// // All angles from horizontal right (+x)
795-
/// // 45 deg counter-clockwise
794+
/// // Positive angles measured counter-clockwise
795+
/// // from positive x axis
796+
/// // -pi/4 radians (45 deg clockwise)
796797
/// let x1 = 3.0f32;
797798
/// let y1 = -3.0f32;
798799
///
799-
/// // 135 deg clockwise
800+
/// // 3pi/4 radians (135 deg counter-clockwise)
800801
/// let x2 = -3.0f32;
801802
/// let y2 = 3.0f32;
802803
///

src/libstd/f64.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ impl f64 {
716716
unsafe { cmath::atan(self) }
717717
}
718718

719-
/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`).
719+
/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
720720
///
721721
/// * `x = 0`, `y = 0`: `0`
722722
/// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]`
@@ -727,12 +727,13 @@ impl f64 {
727727
/// use std::f64;
728728
///
729729
/// let pi = f64::consts::PI;
730-
/// // All angles from horizontal right (+x)
731-
/// // 45 deg counter-clockwise
730+
/// // Positive angles measured counter-clockwise
731+
/// // from positive x axis
732+
/// // -pi/4 radians (45 deg clockwise)
732733
/// let x1 = 3.0_f64;
733734
/// let y1 = -3.0_f64;
734735
///
735-
/// // 135 deg clockwise
736+
/// // 3pi/4 radians (135 deg counter-clockwise)
736737
/// let x2 = -3.0_f64;
737738
/// let y2 = 3.0_f64;
738739
///

0 commit comments

Comments
 (0)