algorithmic modeling for Rhino
Sin(x) you mean?
I think it refers to the SIGN transfer function of Fortran days.
Where you could specify two variables Sign(x,y) which would change the sign of x if y was different.
eg
sign(1,2) = 1
sign(1,-2) = -1
sign(-1,2) = 1
sign(-1,-2) = -1
Thanks.
I was thinking more of the more modern sign() function, where:
-1 if x < 0
sign(x) = 0 if x = 0
1 if x > 0
This can be used as a sign transfer function by multiplication:
sign(x) * whatever
I ended up writing something like "if(x>0,1,-1)", which worked, but isn't very elegant.
A very late note in this thread; this is called the "signum" function, usually denoted "sgn," though some computer languages make it "sign." See http://mathworld.wolfram.com/Sign.html. I still wish Grasshopper included it.
Try to use if(x<0,-1,0)+if(x>0,1,0) , why would be not ....
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by