func drawOrientedLine(gc *draw2d.ImageGraphicContext, x, y float64, theta float64, r float64) { c := math.Cos(theta) s := math.Sin(theta) gc.MoveTo(x-r*c, y-r*s) gc.LineTo(x+r*c, y+r*s) gc.Stroke() }
func WhiteBG(gc *draw2d.ImageGraphicContext, xsize, ysize float64) { gc.BeginPath() gc.MoveTo(0, 0) gc.LineTo(xsize, 0) gc.LineTo(xsize, ysize) gc.LineTo(0, ysize) gc.LineTo(0, 0) gc.Close() gc.SetFillColor(color.RGBA{255, 255, 255, 0xff}) gc.Fill() }
func DrawLine(gc *draw2d.ImageGraphicContext, x1, y1, x2, y2 float64) { gc.MoveTo(x1, y1) gc.LineTo(x2, y2) gc.FillStroke() }