Issue to find angle

need to find angle 1

The angle is already in degrees, so converting from radians to degrees will give you a wrong answer.

For some angles, the atan2 function will avoid division by 0.

For your setup, you only need Ball1 and Ball2:

angle = atan2( (Ball2.Y - Ball1.Y), (Ball2.X - Ball1.X))

(I forgot that Canvas Y runs downwards, not upwards)

1 Like

i delete convet from radians to degrees
but angel also


not correct

Upload your .aia so I can test?

angle = atan2(Y1-Y2,X2-X1) - atan2(Y1-Y3,X3-X1)

because the angle is the difference between the angles of points 2 and 3 off the X axis.
I reversed Y directions for the Canvas.

angle.aia (11.9 KB)

not solved also :upside_down_face: :upside_down_face: :upside_down_face:


45

Capture


angle_ABG.aia (3.6 KB)

1 Like

P.S. The Balls look nicer if you set their origins to their centers, instead of their upper left corners.

Thank you very much, that's what I'm asking
If so, can you give me references for the solution? :heart: :heart:

My high school trigonometry class 60 years ago?

P.S. I had to remove that maths extension.
It was crashing in the Companion, and it was not needed for this example.

2 Likes

math extension
I was just looking for a solution

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.