Skip to content

Functions for normalizing vectors #226

@c42f

Description

@c42f

I find myself commonly writing the trivial utility function normalize(x) = x/norm(x) for geometric computing. Julia has the useful utility cross() in linalg - maybe normalize() and normalize!() belong there too? I see that ImmutableArrays.jl has defined unit() for this though that name clashes with a different use in SIUnits.

For greater than 1D arrays, normalize(x, dim) acting along a dimension would be a useful generalization for me personally. A p-norm version might also be useful.

@SimonDanisch - this is very relevant to 3D graphics - maybe you have some thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions