aoc24/util/vec.go
Samuel 99fdb9371a Day 13 done
I think I'm slowly reaching my limit
Solution for part two (which would also work for part 1) made me realise
that I should probably (re-)read those math books and learn the basics
again
2024-12-13 12:47:39 +01:00

17 lines
258 B
Go

package util
type Vec2 struct {
X, Y int64
}
func (v Vec2) Mult(by int64) Vec2 {
return Vec2{v.X * by, v.Y * by}
}
func (v Vec2) Add(a Vec2) Vec2 {
return Vec2{v.X + a.X, v.Y + a.Y}
}
func (v Vec2) Eq(a Vec2) bool {
return v.X == a.X && v.Y == a.Y
}