Xkonti / govec

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

Implement `IsZero` operation #18

Closed Xkonti closed 1 year ago

Xkonti commented 1 year ago

Checks if the vector is a zero vector.

Example of usage:

vec1 := V2F[float64]{X: 12, Y: 0}
result := vec1.IsZero()
// result is false
sathuhebbar commented 1 year ago

Hello, can I work on this issue?

Thank you.

Xkonti commented 1 year ago

Go ahead 👍

sathuhebbar commented 1 year ago

Cool! I've tried implementing it in this PR. Please have a look. I would be willing to add a few test cases for these functions if required, or I'll raise a separate issue for that if required.

Thanks!

Xkonti commented 1 year ago

@sathuhebbar I can create an issue for adding tests for all operations that need them (most of them) if you want. I plan on looking into testing with testify package soon though. I don't have much experience with testing in Go, so if you can add some value/recommendations it would be much appreciated.

Xkonti commented 1 year ago

@sathuhebbar Here's the testing issue: https://github.com/Xkonti/govec/issues/34

sathuhebbar commented 1 year ago

Sure, will have a look at testify.