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

- 08-17-2004westcardPlease help me... Translate from c++ to visual basic
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 - 08-17-2004pianorain
Looks invalid to me, since there's no return value between the ? and :.

- 08-17-2004westcard
Sorry it should be:

x = (t_x < pi)? x: (x - ( sign( x ) *( 2*pi) )) - 08-17-2004Thantos
Well without knowing vb, an easier to convert syntax would be:

Code:`if ( !(t_x < pi) )`

x = x - sign(x) * (2 * pi);

- 08-17-2004westcard
So it would read:

if t_x not less then pi then x=x-sign(x) *(2*pi)

Correct?? - 08-17-2004Thantos
Well just did a search for "vb tutorial" on google, and the first site got me enough info to give you this:

Code:`If t_x >= pi Then`

x = x - sign(x) * 2 * pi;

- 08-17-2004westcard
thanks