spherical-cow icon indicating copy to clipboard operation
spherical-cow copied to clipboard

Generics for numbers

Open Libbum opened this issue 6 years ago • 0 comments

Currently we are only using f32s, but it would be good if this was generic over reals.

For example:

struct Sphere<N> {
    center: Point3<N>,
    radius: N,
}

impl<N: Float> Sphere<N> {
    /// Creates a `new` sphere given the location of the spheres' `center` and its' `radius`.
    pub fn new(center: Point3<N>, radius: N) -> Sphere {
... etc

Libbum avatar Jan 18 '18 14:01 Libbum