[SOLVED] Question about translating radians to degrees
1814 2 1- AlbertoGZ
- 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!
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
- AlbertoGZ
- 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
This don't want works
float dot = dot(pos1, pos2); float adot = acos(dot);
Edited by AlbertoGZ - April 26, 2020 07:21:31
- AlbertoGZ
- Member
- 34 posts
- Joined: Jan. 2017
- Offline
-
- Quick Links