Added ring/elimination mechanic.
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
package gamedata
|
||||
|
||||
import "math"
|
||||
|
||||
type Coordinates struct {
|
||||
X float64
|
||||
Y float64
|
||||
}
|
||||
|
||||
func (c Coordinates) Distance(p Coordinates) float64 {
|
||||
dx := p.X - c.X
|
||||
dy := p.Y - c.Y
|
||||
return math.Sqrt(dx*dx + dy*dy)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user