func ArcNegative(gc draw2d.GraphicContext, xc, yc, width, height float64) {
	xc += width / 2
	yc += height / 2
	radiusX, radiusY := width/2, height/2
	startAngle := 45.0 * (math.Pi / 180.0)  
	angle := -225 * (math.Pi / 180.0)       
	gc.SetLineWidth(width / 10)
	gc.SetLineCap(draw2d.ButtCap)
	gc.SetStrokeColor(image.Black)
	gc.ArcTo(xc, yc, radiusX, radiusY, startAngle, angle)
	gc.Stroke()
	gc.SetStrokeColor(color.NRGBA{255, 0x33, 0x33, 0x80})
	gc.SetFillColor(color.NRGBA{255, 0x33, 0x33, 0x80})
	gc.SetLineWidth(width / 20)
	gc.MoveTo(xc+math.Cos(startAngle)*radiusX, yc+math.Sin(startAngle)*radiusY)
	gc.LineTo(xc, yc)
	gc.LineTo(xc-radiusX, yc)
	gc.Stroke()
	gc.ArcTo(xc, yc, width/10.0, height/10.0, 0, 2*math.Pi)
	gc.Fill()
}
ArcNegative draws an arc with a negative angle (anti clockwise).
package geometry
import (
	"image"
	"image/color"
	"math"
	"github.com/llgcode/draw2d"
	"github.com/llgcode/draw2d/draw2dkit"
	"github.com/llgcode/draw2d/samples"
	"github.com/llgcode/draw2d/samples/gopher2"
)
func Main(gc draw2d.GraphicContext, ext string) (string, error) {
	Draw(gc, 297, 210)
	return samples.Output("geometry", ext), nil
}
func Bubble(gc draw2d.GraphicContext, x, y, width, height float64) {
	sx, sy := width/100, height/100
	gc.MoveTo(x+sx*50, y)
	gc.QuadCurveTo(x, y, x, y+sy*37.5)
	gc.QuadCurveTo(x, y+sy*75, x+sx*25, y+sy*75)
	gc.QuadCurveTo(x+sx*25, y+sy*95, x+sx*5, y+sy*100)
	gc.QuadCurveTo(x+sx*35, y+sy*95, x+sx*40, y+sy*75)
	gc.QuadCurveTo(x+sx*100, y+sy*75, x+sx*100, y+sy*37.5)
	gc.QuadCurveTo(x+sx*100, y, x+sx*50, y)
	gc.Stroke()
}
func CurveRectangle(gc draw2d.GraphicContext, x0, y0,
	rectWidth, rectHeight float64, stroke, fill color.Color) {
	radius := (rectWidth + rectHeight) / 4
	x1 := x0 + rectWidth
	y1 := y0 + rectHeight
	if rectWidth/2 < radius {
		if rectHeight/2 < radius {
			gc.MoveTo(x0, (y0+y1)/2)
			gc.CubicCurveTo(x0, y0, x0, y0, (x0+x1)/2, y0)
			gc.CubicCurveTo(x1, y0, x1, y0, x1, (y0+y1)/2)
			gc.CubicCurveTo(x1, y1, x1, y1, (x1+x0)/2, y1)
			gc.CubicCurveTo(x0, y1, x0, y1, x0, (y0+y1)/2)
		} else {
			gc.MoveTo(x0, y0+radius)
			gc.CubicCurveTo(x0, y0, x0, y0, (x0+x1)/2, y0)
			gc.CubicCurveTo(x1, y0, x1, y0, x1, y0+radius)
			gc.LineTo(x1, y1-radius)
			gc.CubicCurveTo(x1, y1, x1, y1, (x1+x0)/2, y1)
			gc.CubicCurveTo(x0, y1, x0, y1, x0, y1-radius)
		}
	} else {
		if rectHeight/2 < radius {
			gc.MoveTo(x0, (y0+y1)/2)
			gc.CubicCurveTo(x0, y0, x0, y0, x0+radius, y0)
			gc.LineTo(x1-radius, y0)
			gc.CubicCurveTo(x1, y0, x1, y0, x1, (y0+y1)/2)
			gc.CubicCurveTo(x1, y1, x1, y1, x1-radius, y1)
			gc.LineTo(x0+radius, y1)
			gc.CubicCurveTo(x0, y1, x0, y1, x0, (y0+y1)/2)
		} else {
			gc.MoveTo(x0, y0+radius)
			gc.CubicCurveTo(x0, y0, x0, y0, x0+radius, y0)
			gc.LineTo(x1-radius, y0)
			gc.CubicCurveTo(x1, y0, x1, y0, x1, y0+radius)
			gc.LineTo(x1, y1-radius)
			gc.CubicCurveTo(x1, y1, x1, y1, x1-radius, y1)
			gc.LineTo(x0+radius, y1)
			gc.CubicCurveTo(x0, y1, x0, y1, x0, y1-radius)
		}
	}
	gc.Close()
	gc.SetStrokeColor(stroke)
	gc.SetFillColor(fill)
	gc.SetLineWidth(10.0)
	gc.FillStroke()
}
func Dash(gc draw2d.GraphicContext, x, y, width, height float64) {
	sx, sy := width/162, height/205
	gc.SetStrokeColor(image.Black)
	gc.SetLineDash([]float64{height / 10, height / 50, height / 50, height / 50}, -50.0)
	gc.SetLineCap(draw2d.ButtCap)
	gc.SetLineJoin(draw2d.RoundJoin)
	gc.SetLineWidth(height / 50)
	gc.MoveTo(x+sx*60.0, y)
	gc.LineTo(x+sx*60.0, y)
	gc.LineTo(x+sx*162, y+sy*205)
	rLineTo(gc, sx*-102.4, 0)
	gc.CubicCurveTo(x+sx*-17, y+sy*205, x+sx*-17, y+sy*103, x+sx*60.0, y+sy*103.0)
	gc.Stroke()
	gc.SetLineDash(nil, 0.0)
}
func Arc(gc draw2d.GraphicContext, xc, yc, width, height float64) {
	xc += width / 2
	yc += height / 2
	radiusX, radiusY := width/2, height/2
	startAngle := 45 * (math.Pi / 180.0)  
	angle := 135 * (math.Pi / 180.0)      
	gc.SetLineWidth(width / 10)
	gc.SetLineCap(draw2d.ButtCap)
	gc.SetStrokeColor(image.Black)
	gc.MoveTo(xc+math.Cos(startAngle)*radiusX, yc+math.Sin(startAngle)*radiusY)
	gc.ArcTo(xc, yc, radiusX, radiusY, startAngle, angle)
	gc.Stroke()
	gc.SetStrokeColor(color.NRGBA{255, 0x33, 0x33, 0x80})
	gc.SetFillColor(color.NRGBA{255, 0x33, 0x33, 0x80})
	gc.SetLineWidth(width / 20)
	gc.MoveTo(xc+math.Cos(startAngle)*radiusX, yc+math.Sin(startAngle)*radiusY)
	gc.LineTo(xc, yc)
	gc.LineTo(xc-radiusX, yc)
	gc.Stroke()
	gc.MoveTo(xc, yc)
	gc.ArcTo(xc, yc, width/10.0, height/10.0, 0, 2*math.Pi)
	gc.Fill()
}