We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I expected this to be a lot closer to 45 degrees
default::Vector2D::new(0.5, 0.5).angle_from_x_axis().to_degrees() = 44.98835851188444
The text was updated successfully, but these errors were encountered:
angle_from_x_axis is implemented on top of a faster but less precise atan2.
angle_from_x_axis
let v = Vector2D::new(0.5, 0.5); let a1: f32 = v.angle_from_x_axis().radians; // 0.785195 let a2 = v.y.atan2(v.x); // 0.7853982 let a3 = std::f32::consts::PI / 4.0; // 0.7853982 let error = (a1 - a3).abs() // 0.00020319223
It would maybe make sense for the function to be slower and more precise by default and provide fast_angle_from_x_axis on the side.
fast_angle_from_x_axis
Sorry, something went wrong.
No branches or pull requests
I expected this to be a lot closer to 45 degrees
default::Vector2D::new(0.5, 0.5).angle_from_x_axis().to_degrees() = 44.98835851188444
The text was updated successfully, but these errors were encountered: