Last active
September 7, 2016 07:41
-
-
Save Szeliga/ee75e5f0d3d98c89c1438b64cfe7139d to your computer and use it in GitHub Desktop.
02-vector-operations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (a *Vector) Add(b Vector) Vector { | |
a.X += b.X | |
a.Y += b.Y | |
a.Z += b.Z | |
return a | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package core | |
import "math" | |
// Vector - struct holding X Y Z values of a 3D vector | |
type Vector struct { | |
X, Y, Z float64 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment