github.com/egonelbre/exp@v0.0.0-20240430123955-ed1d3aa93911/overload/g/vector.go (about)

     1  package g
     2  
     3  type Vector struct{ X, Y float32 }
     4  
     5  func (a Vector) Add(b Vector) Vector {
     6  	return Vector{a.X + b.X, a.Y + b.Y}
     7  }