-
Sqr And Sqrt
i tried using the SQR function in VB,and it gave me a wrong answer. i did some search and i got this:
# SQR
The square function returns the square (ie the argument multiplied by itself) of its supplied argument,
SQR( 2 ) returns 4
# SQRT
This function returns {always returns a real} the square root of its argument, eg,
SQRT( 4 ) returns 2.0000000000E+00
could someone explain how would i use each of these two functions in VB?
-
Re: Sqr And Sqrt
There is no SQRT in VB, I do not know what you were referencing
SQR in VB: Returns the square root of a number
To return the square: 4 * 4, or 4 ^ 2
-
Re: Sqr And Sqrt
so for example i have this equation i want to calculate in VB:
4*Sqrt((98*800*1.00)/(4*Sqr(230)*Sin(Rad(2*70))))
-
Re: Sqr And Sqrt
Replace Sqr(230) with (230*230)
Then replace Sqrt with SQR
There is also no RAD function in VB.
-
Re: Sqr And Sqrt
-
Re: Sqr And Sqrt
Other than Rapid Application Development, what is RAD?
-
Re: Sqr And Sqrt
in math, it means radian :)
i dimmed as double and added Rad=57.2958
now im trying to do it with this equation:
2*(ABS(46*800+SIN(PI()/180*-1)*1*800-COS(PI()/180*-1)*1*0))/(sqr(2*2)*175*sqrt(((46+SIN(PI()/180*-1)*1)*COS(PI()/180*-81)-COS(PI()/180*-1)*1*SIN(PI()/180*-81))*(0*COS(PI()/180*-81)-800*SIN(PI()/180*-81))))
i got everything right, except for this part: sqrt(((46+SIN(PI()/180*-1)*1), and for the PI, i declared the PI as double and everything but it gives me "expected array" error
-
Re: Sqr And Sqrt
In case others might be interested, I found this
http://www.devx.com/vb2themax/Tip/19029