so I have worked out how to do my trigonometry in vex. But I am confusing myself with the "if" question.
I need to get a value within a range? my heads broken.
how do I phrase an "if("float" is > 90 but < than 180)"
1590 6 2-
- Getyamamout
- Member
- 76 posts
- Joined: Dec. 2020
- Offline
-
- Getyamamout
- Member
- 76 posts
- Joined: Dec. 2020
- Offline
-
- animatrix_
- Member
- 5183 posts
- Joined: Feb. 2012
- Online
That looks correct but you don't need extra parentheses;
if ( name > 90 && name < 180 )
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- Andr
- Member
- 899 posts
- Joined: Feb. 2016
- Offline
-
- malexander
- Staff
- 5307 posts
- Joined: July 2005
- Offline
Andr
I've always hoped to be able to doif(90< name < 180)
it'd make it faster to type and to grasp on quick look
That's a scary expression, because it would look like it's working, but it'd evaluate (90<name) first, giving you 0 or 1, which is then always less than 180, so the expression is always true. If it worked in VEX, it would bite you when you started programming in some other language.
-
- Andr
- Member
- 899 posts
- Joined: Feb. 2016
- Offline
-
- Getyamamout
- Member
- 76 posts
- Joined: Dec. 2020
- Offline
-
- Quick Links


