Skip to content

Generics for numbers #1

@Libbum

Description

@Libbum

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions