tins2020/point.go
Sander Schobers 27afe594fe Added renderer.
Added props.
Added map movement (dragging & hovering).
2020-05-09 13:55:37 +02:00

19 lines
407 B
Go

package tins2020
type Point struct {
X, Y int32
}
func (p Point) Add(q Point) Point { return Pt(p.X+q.X, p.Y+q.Y) }
type PointF struct {
X, Y float32
}
func (p PointF) Add(q PointF) PointF { return PtF(p.X+q.X, p.Y+q.Y) }
func (p PointF) Sub(q PointF) PointF { return PtF(p.X-q.X, p.Y-q.Y) }
func Pt(x, y int32) Point { return Point{x, y} }
func PtF(x, y float32) PointF { return PointF{x, y} }