Radians problem?

I am looking at your demo. The first arc (centered at (100,100)) begins at 0º, ends at 90 º, from where a line goes to the beginning of the second arc (which is centered at (200,200)), specifically to the first point of the second arc (0º), then the second arc completes up to 90º.

Can you draw what you expect? Your code is connecting the two arcs exactly as I would expect.

Julen

1 Like

You are still thinking that ClockWise and contra-ClockWise are wrong, I think that is the problem.

Try this experiment, ask someone to stand in front of you and draw an Arc from 90 degrees to 0 degrees clockwise, what you will see is that that person is drawing (to your perspective) an arc from 90 degrees to 180 degrees contra-clockwise. The same is happening here.

I downloaded your examples, very good by the way, here is how Xojo is working:


the first semicircle starts at 0, ends in 90, then go to second semicircle that starts in 0 and ends in 90. Remember this clockwise is for the person at the other side of the plane in front of you, so their clockwise is going to look counterclockwise for you.

I’m not saying the implementation is wrong or not, just trying to explain what is happening.

With this one, I think you still thinking, that you flipped y so clockwise should be clockwise and is not:


The problem here is that the “person” drawing the arc is still in front of you, so you are asking them to draw an arc from 180 to 90 clockwise and you, with a different perspective, are seeing the arc go from 0 to 90 counterclockwise.

1 Like

I disagree. Rotation angle is positive regardless of the point of view, but not whether it is clockwise or counterclockwise rotation.

Imagine you have a wheel mounted on a shaft and it’s spinning. Two people look at it from different sides of the wheel. They agree on the reference system they will use so both of them can say that the rotation is positive (or negative) in that reference system, but one of them will see the wheel rotating clockwise and the other one counter-clockwise.

We are talking about a Canvas that is used in Xojo, which defines not only the reference system we will be using but also our point of view over that system, and therefore clockwise has a meaning in this context: clockwise in a canvas where the origin is at the top, left corner.

So the drawing direction of the addarc function is incorrect.

Julen

To match the 0,0 and X,Y movement, we need to consider that the person in front of us is also upside down, something like this:
image
The person laying on the floor below the glass table will see the “correct” plane as we learn in school, the person above the table will see the plane just as a computer program is displaying the results.

Now imagine that you ask the person laying on the flor to go to 50 X and start drawing a 90 degree arc counterclockwise, what would the person standing will see? A line starting at 50 X going down clockwise and end at 90 degrees (on this flipped plane).

Now ask the person to go to 50 Y and draw an arc clockwise for 90 degrees, the person standing over the glass table will see that the arc starts down at 90 degrees, move counterclockwise and end in 0 degrees on X.

Hope this helps.

That’s completely right, but out of context here.

We all are over the table, and nobody is below it. If I tell you I am going to draw an arc that goes from 0º to 90º clockwise you expect me to draw a quarter of a circle on that table, which we both see as a clockwise circular displacement.

That’s not how AddArc currently works.

Correct, I’m just trying to illustrate how is working. As if Xojo was the drawing subject and we are the person looking at the glass table (screen).

People can ask Xojo to change the behavior or change the docs.

The OP is getting confused by our off topic talk (and that might happen to future readers) so we should avoid saying that the drawing direction is correct, which is not for a Xojo Canvas.

Besides, we aren’t helping the OP.

So pleaae Phil,

You didn’t mention the Boolean.

The appearance is what I expect, but the boolean value is always wrong.

Following the line from start to end, your eye is traveling anticlockwise, but the clockwise is checked.

(I think I have an error somewhere as the flipx + swapends actually flips both but the problem still exists regardless.)

But why on earth would I draw backwards so that someone seeing the back of my arc would see it correctly???

1 Like

I think I DID mention the boolean before.

1 Like

I don’t know, how about this, just asume that the documents are wrong and instead of ClockWise boolean is CounterClockWise boolean. I think with that change, and knowing that Y is flipped, everything works correctly, right?