Why does the following code add another line to the arc?
dim height as Double = 50
dim curve as Double = 50
dim offset as Double = 20
g.PenSize = 2
dim HalfPen as Double = g.PenSize/2
Const Pi = 3.14159
Dim p As New GraphicsPath
p.MoveToPoint(HalfPen, height + HalfPen)
p.AddLineToPoint(offset + HalfPen, height + HalfPen)
p.AddArc(offset + HalfPen, height + HalfPen - curve, curve, 0, Pi/2, False)
g.DrawPath(p, False)
The result should be a horizontal line and an arc. But I get an additional line:
It took me some time to understand that the graphics are upside/down, so the arc to create a circle is like this:
I edited the code to change 3*pi/2 to 0. You wanted to create an Arc from 90 to 0 but your code said to draw it from 0 to 90 that is why you got a ‘connecting’ line.
Also, the clockwise boolean is backward as we normally use because the graphics are flipped, so an arc from 90 to 0 that is counter-clockwise for us is clockwise for the graphic path.
I hope this information helps to make sense on how to use the arc.