Since many languages use this as a reserved word. Maybe it would be even clearer to use something like p1, p2 or A,B ? func (p1 Point) distance(p2 Point) float64 { return math.Sqrt(p1.x*p2.x + p1.y*p2.y) }
Since many languages use this as a reserved word. Maybe it would be even clearer to use something like p1, p2 or A,B ?
func (p1 Point) distance(p2 Point) float64 {
return math.Sqrt(p1.xp2.x + p1.yp2.y)
}