pub trait FromF64 {
// Required method
fn from_f64(value: f64) -> Self;
}Expand description
Construct a scalar from an f64 literal.
Lives in geometry-cs rather than geometry-coords because it is
only ever needed for the degree↔radian conversion factor — the rest
of the kernel either uses T::ZERO / T::ONE from
CoordinateScalar or stays in the scalar type the caller picked.
Keeping the bound local means strategies that never touch angle
units do not pay for it.
§Examples
use geometry_cs::FromF64;
assert_eq!(f64::from_f64(1.5), 1.5);
assert_eq!(f32::from_f64(1.5), 1.5_f32);Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".