Q: Expression function that returns all value negative

   5534   5   1
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
Hi,

abs() returns all absolute value but is there such a function that returns all negative or make the value always negative? Is there not one because users can simply type ‘-’ infront of any expressions they use?

I scanned through http://www.sidefx.com/docs/houdini11.0/expressions/ [sidefx.com], either it's not there or it eluded me.

Cheers!

eitht.
User Avatar
Member
1631 posts
Joined: July 2005
Offline
Yep, you can simply put “-” in front of the expression.

Cheers!
steven
User Avatar
Member
8555 posts
Joined: July 2007
Offline
probably there isn't one,
there is no need for wrapping -abs() into a new function or is it?

EDIT: steven was faster
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
I believe the question i have here is simple math, was trying to offset the Y translation of a torus object.

Have 2 different chains of nodes which produces the same results, one had “-6” & the other “-4.3” - shouldn't it having “-6” on either give me the same translation… I'm confused.

eitht.

Attachments:
01_xform_object_eitht.hip (250.6 KB)

User Avatar
Member
8555 posts
Joined: July 2007
Offline
simple math:
you may be thinking that
1. you have initial transform of 0.85 which is relative referenced parameter
2. on one side you add -4.3 to it in the referencing expression
3. on second side you transform it -6 with another transform sop
4. and yet they both result in the same position (0.85-4.3 == 0.85-6 ?)

but in reality in your file you are not adding -4.3 to 0.85 but to -0.85
so one side: -0.85 + (-4.3) = -5.15
second side: 0.85 - 6 = -5.15
so they are equal and therefore they result in the same position
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
Ok that makes perfect sense, i'm going to enroll in lessons to brush up math. O_O
/bow, tamte and steven!
eitht.
  • Quick Links