Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed clockwise/counter-clockwise in atan2 documentation in f32 and f64 and included that it returns radians #49254

Merged
merged 1 commit into from
Mar 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/libstd/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ impl f32 {
unsafe { cmath::atanf(self) }
}

/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`).
/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
///
/// * `x = 0`, `y = 0`: `0`
/// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]`
Expand All @@ -791,12 +791,13 @@ impl f32 {
/// use std::f32;
///
/// let pi = f32::consts::PI;
/// // All angles from horizontal right (+x)
/// // 45 deg counter-clockwise
/// // Positive angles measured counter-clockwise
/// // from positive x axis
/// // -pi/4 radians (45 deg clockwise)
/// let x1 = 3.0f32;
/// let y1 = -3.0f32;
///
/// // 135 deg clockwise
/// // 3pi/4 radians (135 deg counter-clockwise)
/// let x2 = -3.0f32;
/// let y2 = 3.0f32;
///
Expand Down
9 changes: 5 additions & 4 deletions src/libstd/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ impl f64 {
unsafe { cmath::atan(self) }
}

/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`).
/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
///
/// * `x = 0`, `y = 0`: `0`
/// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]`
Expand All @@ -727,12 +727,13 @@ impl f64 {
/// use std::f64;
///
/// let pi = f64::consts::PI;
/// // All angles from horizontal right (+x)
/// // 45 deg counter-clockwise
/// // Positive angles measured counter-clockwise
/// // from positive x axis
/// // -pi/4 radians (45 deg clockwise)
/// let x1 = 3.0_f64;
/// let y1 = -3.0_f64;
///
/// // 135 deg clockwise
/// // 3pi/4 radians (135 deg counter-clockwise)
/// let x2 = -3.0_f64;
/// let y2 = 3.0_f64;
///
Expand Down