S skyracer90 Member Licensed User Longtime User Dec 5, 2021 #1 Hello dear Community, maybe someone can help me. How can i calculate the angle like the B4X Turtle does with the arrow? I move an X and Y axis and now want to calculate the setting angle in degree for the A axis like the Turtle Arrow... Unfortunately I have no mathematical idea ... Thanks for every approach. Of course I don't want to use the "Turtle" function ...
Hello dear Community, maybe someone can help me. How can i calculate the angle like the B4X Turtle does with the arrow? I move an X and Y axis and now want to calculate the setting angle in degree for the A axis like the Turtle Arrow... Unfortunately I have no mathematical idea ... Thanks for every approach. Of course I don't want to use the "Turtle" function ...
klaus Expert Licensed User Longtime User Dec 6, 2021 #2 I would suggest to use ATan2 or ATan2D instead of ATan or ATan2. ATan2 (Y As Double, X As Double) You enter x and y and the method does the rest, no need to check it y = 0. Log(ATan2D(10, 0)) returns 90° Log(ATan2D(-10, 0)) returns -90° Upvote 1
I would suggest to use ATan2 or ATan2D instead of ATan or ATan2. ATan2 (Y As Double, X As Double) You enter x and y and the method does the rest, no need to check it y = 0. Log(ATan2D(10, 0)) returns 90° Log(ATan2D(-10, 0)) returns -90°
S skyracer90 Member Licensed User Longtime User Dec 8, 2021 #3 Thank you, Klaus. That is exactly what I have been looking for. Upvote 0