Derek McQuay
b9bc23566f
should be valuable to know what distance between two points is. Also added testing
12 lines
177 B
Go
12 lines
177 B
Go
package rect
|
|
|
|
import "math"
|
|
|
|
type Point struct {
|
|
X, Y float64
|
|
}
|
|
|
|
func distance(p1, p2 Point) float64 {
|
|
return math.Sqrt(math.Pow((p1.X-p2.X), 2) + math.Pow((p1.Y-p2.Y), 2))
|
|
}
|