can someone help me translate this into visual basic
x = (t_x < pi)? : (x - ( sign( x ) *( 2*pi) ))
function sign(X)
just returns a 1 if x is positive and a -1 if it is negitive
Printable View
can someone help me translate this into visual basic
x = (t_x < pi)? : (x - ( sign( x ) *( 2*pi) ))
function sign(X)
just returns a 1 if x is positive and a -1 if it is negitive
Looks invalid to me, since there's no return value between the ? and :.
Sorry it should be:
x = (t_x < pi)? x: (x - ( sign( x ) *( 2*pi) ))
Well without knowing vb, an easier to convert syntax would be:
Code:if ( !(t_x < pi) )
x = x - sign(x) * (2 * pi);
So it would read:
if t_x not less then pi then x=x-sign(x) *(2*pi)
Correct??
Well just did a search for "vb tutorial" on google, and the first site got me enough info to give you this:
Of course I don't have any way of testing it :)Code:If t_x >= pi Then
x = x - sign(x) * 2 * pi;
thanks