| 1 | // pathfinder/geometry/src/angle.rs |
| 2 | // |
| 3 | // Copyright © 2020 The Pathfinder Project Developers. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | // option. This file may not be copied, modified, or distributed |
| 9 | // except according to those terms. |
| 10 | |
| 11 | //! Angle utilities. |
| 12 | |
| 13 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::f32rust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/::constsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/::PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/PI.; |
| 14 | |
| 15 | #[inline] |
| 16 | pub fn angle_from_degreesrust-analyzer cargo pathfinder_geometry 0.5.1 angle/angle_from_degrees().(degrees: f32) -> f32 { |
| 17 | const SCALErust-analyzer cargo pathfinder_geometry 0.5.1 angle/SCALE.: f32 = 2.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().PIrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/consts/PI. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().360.0; |
| 18 | degrees rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().SCALErust-analyzer cargo pathfinder_geometry 0.5.1 angle/SCALE. |
| 19 | } |