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() }