Skip to content
New issue

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

Metric spaces #20

Open
brendanzab opened this issue Jul 30, 2017 · 1 comment
Open

Metric spaces #20

brendanzab opened this issue Jul 30, 2017 · 1 comment

Comments

@brendanzab
Copy link
Contributor

cgmath currently has a MetricSpace trait that is defined for vectors, points, and quaternions:

pub trait MetricSpace: Sized {
    type Metric: BaseFloat;
    fn distance2(self, other: Self) -> Self::Metric;

    fn distance(self, other: Self) -> Self::Metric { ... }
}

Could we consider rejiggering the alga::linear trait hierarchy to add something like this?

@sebcrozet
Copy link
Member

Yes, adding metric spaces would be useful. Though I am still not sure what the best definition would be because of the link between dot product (already available on the FiniteDimInnerSpace) and the metric it induces. But any suggestion is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants