func DotProductInt(v1, v2 Vector2D) int { return v1.x*v2.x + v1.y*v2.y } func DotProductFloat(v1, v2 Vector2DFloat) float64 { return v1.x*v2.x + v1.y*v2.y }
type Vector2D<t> struct { x, y t } func DotProduct(v1, v2 Vector2D<t>) t { return v1.x*v2.x + v1.y*v2.y }