AddArc - bug or intended parameters?

Hello,

Maybe I am getting this incorrect, and it seems like the radians used in the GraphicsPath AddArc command has inverted the angles and the clockwise parameter? Could Someone check to see that I am thinking correctly on this? Is this a bug or is this the way that Xojo intends to draw an arc?

Positions for degrees/radians is to have the 0 position to the right, and moving in a counter clockwise direction to 180 degrees/Pi radians to the left – here is what I am used to:

According to the Xojo documentation (https://documentation.xojo.com/api/graphics/graphicspath.html#graphicspath-addarc), the start angle in my example is 90 degrees (Pi/2 radians) and should start at the top of the diagram (not the bottom as shown). The arc should be drawn in a clockwise direction with the true parameter, and seems to draw in a counterclockwise direction. The endAngle is to be Pi (180 degrees) which is correct.

CurrentArc

Here is my code for the program:

Attached is the AddArc example program that has been created on Windows 10, Xojo 2020 r2.1.
AddArc.zip

Thank you

It looks like:

  1. The sense of the clockwise parameter is inverted

  2. The arc to be drawn implies a circle. The angles (startAngle, endAngle) refer to the directions in which the two radiuses of the circle, given by the start and end points, point. If you imagine a compass, then pointing East gives an angle of 0.0, South gives Pi/2, West gives Pi, and North gives 3Pi/2. This is how the start and end angles may be derived. The two angle parameters are not inverted.

1 Like

If you take your picture and rotate it 180 ° around the Y axis you get what you expected. Note that if you apply that rotation the X and Y axes get into their common position (in Xojo the Y axis is inverted with respect to its common direction).

My interpretation is that Xojo draws the arc as expected with respect to the XY system, but the system is not represented as we are used to looking at it, so it seems that the arc is not being correctly drawn.

In my opinion this is a bug.

Julen
.

1 Like