some refinement and beginning of a table element
This commit is contained in:
19
common/geo/point.go
Normal file
19
common/geo/point.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package geo
|
||||
|
||||
type Point struct {
|
||||
X, Y int
|
||||
}
|
||||
|
||||
func (p Point) Delta(p2 Point) Point {
|
||||
return Point{
|
||||
X: p2.X - p.X,
|
||||
Y: p2.Y - p.Y,
|
||||
}
|
||||
}
|
||||
|
||||
func (p Point) Add(p2 Point) Point {
|
||||
return Point{
|
||||
X: p.X + p2.X,
|
||||
Y: p.Y + p2.Y,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user