bevy/crates
Daniel Beckwith 488f64d700
Fix atan2 docs (#16673)
# Objective

The parameter names for `bevy::math::ops::atan2` are labelled such that
`x` is the first argument and `y` is the second argument, but it passes
those arguments directly to
[`f32::atan2`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.atan2),
whose parameters are expected to be `(y, x)`. This PR changes the
parameter names in the bevy documentation to use the correct order for
the operation being performed. You can verify this by doing:

```rust
fn main() {
    let x = 3.0;
    let y = 4.0;
    let angle = bevy::math::ops::atan2(x, y);
    // standard polar coordinates formula
    dbg!(5.0 * angle.cos(), 5.0 * angle.sin());
}
```

This will print `(4.0, 3.0)`, which has flipped `x` and `y`. The problem
is that the `atan2` function to calculate the angle was really expecting
`(y, x)`, not `(x, y)`.

## Solution

I flipped the parameter names for `bevy::math::ops::atan2` and updated
the documentation. I also removed references to `self` and `other` from
the documentation which seemed to be copied from the `f32::atan2`
documentation.

## Testing

Not really needed, you can compare the `f32::atan2` docs to the
`bevy::math::ops::atan2` docs to see the problem is obvious. If a test
is required I could add a short one.
## Migration Guide

I'm not sure if this counts as a breaking change, since the
implementation clearly meant to use `f32::atan2` directly, so it was
really just the parameter names that were wrong.
2024-12-10 03:19:05 +00:00
..
bevy_a11y Remove accesskit re-export from bevy_a11y (#16257) 2024-11-08 21:01:16 +00:00
bevy_animation ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
bevy_app Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
bevy_asset ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
bevy_audio Update rodio requirement from 0.19 to 0.20 (#16359) 2024-12-03 17:55:42 +00:00
bevy_color Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
bevy_core Support on_thread_spawn and on_thread_destroy for TaskPoolPlugin (#13045) 2024-11-11 20:00:01 +00:00
bevy_core_pipeline ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
bevy_derive move ANDROID_APP to bevy_window (#15585) 2024-10-02 03:01:06 +00:00
bevy_dev_tools Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
bevy_diagnostic Revert "Update sysinfo version to 0.32.1 (#16517)" (#16523) 2024-11-26 22:44:23 +00:00
bevy_dylib Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_ecs Rename trigger.entity() to trigger.target() (#16716) 2024-12-08 21:55:09 +00:00
bevy_encase_derive Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +00:00
bevy_gilrs Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
bevy_gizmos ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
bevy_gltf ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
bevy_hierarchy Improve child_builder add_child documentation slightly (#16663) 2024-12-10 03:15:52 +00:00
bevy_image ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
bevy_input Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
bevy_input_focus bevy_input_focus improvements (follow-up PR) (#16665) 2024-12-06 01:16:52 +00:00
bevy_internal bevy_input_focus improvements (follow-up PR) (#16665) 2024-12-06 01:16:52 +00:00
bevy_log Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_macro_utils Modify derive_label to support no_std environments (#15465) 2024-09-27 20:23:26 +00:00
bevy_math Fix atan2 docs (#16673) 2024-12-10 03:19:05 +00:00
bevy_mesh ⬆️ Upgrade typos and its configuration (#16712) 2024-12-08 17:25:10 +00:00
bevy_mikktspace Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_pbr Document why MAX_JOINTS and MAX_MORPH_WEIGHTS are set (#16324) 2024-12-10 02:03:51 +00:00
bevy_picking Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking. (#16331) 2024-12-10 02:20:48 +00:00
bevy_ptr Fix MSRVs for standalone crates (#16333) 2024-11-17 09:38:13 +00:00
bevy_reflect bevy_reflect: Function Overloading (Generic & Variadic Functions) (#15074) 2024-12-10 01:51:47 +00:00
bevy_remote BrpQueryRow has field deserialization fix (#16613) 2024-12-04 18:26:33 +00:00
bevy_render Allow holes in the MeshInputUniform buffer. (#16695) 2024-12-09 02:11:27 +00:00
bevy_scene Rename trigger.entity() to trigger.target() (#16716) 2024-12-08 21:55:09 +00:00
bevy_sprite ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
bevy_state Make StateTransitionSteps public (#16612) 2024-12-03 19:48:00 +00:00
bevy_tasks Add no_std support to bevy_tasks (#15464) 2024-12-06 02:14:54 +00:00
bevy_text fix tiny copy-paste mistake in bevy_text::font_atlas_set (#16667) 2024-12-10 03:17:09 +00:00
bevy_time Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_transform Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
bevy_ui ⬆️ Upgrade typos and its configuration (#16712) 2024-12-08 17:25:10 +00:00
bevy_utils Move all_tuples to a new crate (#16161) 2024-12-03 17:41:09 +00:00
bevy_window add missing type registration for Monitor (#16685) 2024-12-06 15:20:10 +00:00
bevy_winit Rename trigger.entity() to trigger.target() (#16716) 2024-12-08 21:55:09 +00:00