Skip to content

Instantly share code, notes, and snippets.

@Szeliga
Last active September 7, 2016 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Szeliga/ee75e5f0d3d98c89c1438b64cfe7139d to your computer and use it in GitHub Desktop.
Save Szeliga/ee75e5f0d3d98c89c1438b64cfe7139d to your computer and use it in GitHub Desktop.
02-vector-operations
func (a *Vector) Add(b Vector) Vector {
a.X += b.X
a.Y += b.Y
a.Z += b.Z
return a
}
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