glam-rs icon indicating copy to clipboard operation
glam-rs copied to clipboard

Add method to vector types that returns direction and length

Open bitshifter opened this issue 3 years ago • 3 comments

It's not uncommon to find the direction and length of a vector, but it is a hassle to do it manually. It would be good to have a method for this.

bitshifter avatar May 30 '22 21:05 bitshifter

Just poking through the open issues and seeing if there is anything I can help with.

Looks like length is already done: https://docs.rs/glam/0.21.3/glam/?search=length Direction would probably just be normalize which is already done too: https://docs.rs/glam/0.21.3/glam/?search=normalize Unless you meant something else.

Anything else needed/missing here?

We could probably add a doc alias for normalize or something if we wanted to make normalize show up when you search for "direction"

paul-hansen avatar Sep 03 '22 19:09 paul-hansen