[SOLVED] Question about translating radians to degrees

   1813   2   1
User Avatar
Member
34 posts
Joined: Jan. 2017
Offline
Since math operations are working good, I have a problem in translation its values in a “user” readable values in degrees. I mean, I'm not achieving that radians to degrees equivalency are computing as expected.
For example point with id 10 have 90deg in relation to its neighbors, so if angle threshold parameter is set in 89deg this point should leave from group. But in radians, the math operation is ok, because its angle in radians is 0.0, and angle threshold is 1.5534, so condition is true for point 10.

Any suggestion to translate radians to degrees properly is welcome. Thanks!
Edited by AlbertoGZ - April 26, 2020 08:24:57

Attachments:
Captura de pantalla 2020-04-26 a las 0.49.27.png (827.0 KB)

User Avatar
Member
34 posts
Joined: Jan. 2017
Offline
I see adding Arc Cosine to vector, then I get the right angle. However this are working for attribute (@dot), but not in variable (dot) that fails without converting to degrees, since vex need radians to compute.

This don't want works

float dot = dot(pos1, pos2);
float adot = acos(dot);
Edited by AlbertoGZ - April 26, 2020 07:21:31

Attachments:
Captura de pantalla 2020-04-26 a las 13.13.36.png (449.1 KB)

User Avatar
Member
34 posts
Joined: Jan. 2017
Offline
Well, I think now is working as I expected. User control in degrees and angle threshold from 0 to 90 deg.
Excuse me for posting

Attachments:
Captura de pantalla 2020-04-26 a las 14.15.24.png (1.2 MB)

  • Quick Links