I'm using DrawArc to create arc segments. It's the usual "3 known points on a circle" routine.
When my graphics are oriented one direction, everything is fine (see below):
When I build the graphics with a different orientation, the segments are flipped around the x-axis (see below):
Note the values that are being sent to DrawArc(pen, rectangle, start, sweep). In Condition #1, the start angle is 126° and the sweep angle is 106°. The result is exactly what I would expect.
In Condition #2, the start angle is 216° and the sweep angle is 106°. The data is correct; the result appears like the start angle and resulting arc are a mirror image of what they should be. And this applies to all four arcs. It's almost like something is adding 180° to the start angle.
I'm using the same call to DrawArc for both conditions.
If my baseline for arcs is on a 45° angle, I also get erroneous results, but it appears like something is adding 90° to the start angle.
Thank you in advance for any suggestions!
George
Without seeing your code I'll start with some general remarks that might explain this, based on what you describe:
1) if you're using a 'standard' function to determine whether the sweep is clockwise or counter-clockwise then note that in maths generally the y axis starts at the bottom while in VB.NET it starts at the top so a function like that would give the 'reverse' result.
2) also note that your calculated angles seem to be based on starting (correctly) on the rightmost point of the circle but going counter-clockwise while the DrawArc documentation states it is defined as clockwise. In your first example it doesn't matter as all circles are intersected by the vertical line (from point 2 to 15), just the sweep angle would have to be reversed. But then of course if you combine this with the previous note, a 'flipped' canvas would negate this second note...!
Now after some trial and error I came up with the code below, which processes both your examples correctly as you can see in the image.
Open in new window
Obviously, whether this helps you may depend largely on the compatibility of the called functions with yours. But for starters I think this bit together with the remarks above may enable you to determine the problem. If you think my exact implementation can help you further, please look at the attached project which by now includes some nice bells and whistles (like moving the individual points and calculate the result real-time).prj.zip