Xkonti / govec

Go library providing 2D and 3D vector operations
MIT License
6 stars 7 forks source link

Implement `RotateRad` operation #24

Closed Xkonti closed 1 year ago

Xkonti commented 1 year ago

Rotates a vector by an angle specified in radians.

Functions for integer vectors should return a float vector.

sathuhebbar commented 1 year ago

Right, can I work on this?

Xkonti commented 1 year ago

Sure, But I'm not sure what's the usual approach for 3D vectors here. RotateRadXAxis? RotateRadPlane? RotateRadQuaternion? Do you have any suggestions?

Xkonti commented 1 year ago

@sathuhebbar I think for now let's limit it only to V2F and V2I vectors. This way rotation will be easy to implement. I have plans for 3D vectors for after v1.0.0

sathuhebbar commented 1 year ago

Oh cool. I was just looking up 3D rotations and thought we could use quaternion rotation. But for now, I'll implement these.

Xkonti commented 1 year ago

Yeah. After 1.0.0 I'm thinking about adding concepts of "quaternions" and "planes" to allow more advanced 3D vector operations but without having to have a PHD in math.

sathuhebbar commented 1 year ago

pHD in math XD. Yup having a quaternion type would make it convenient. I've added the 2D vector methods here.

Thanks!