Home All Groups Group Topic Archive Search About
Author
6 Jan 2006 7:49 AM
JamesB
I am trying to use the math.sin(value) function but it seems to give me the
wrong answer!
For instance, math.sin(1) is returning 0.84147098.... whereas windows calc
doing 1 then pressing sin gives me 0.017452406.....

Where am I going wrong? Or can't VB add up?

Author
6 Jan 2006 7:58 AM
guy
system.math.sin works in radians, the answer you got forom calculator is
sin(1) in degrees

hth

guy

Show quoteHide quote
"JamesB" wrote:

> I am trying to use the math.sin(value) function but it seems to give me the
> wrong answer!
> For instance, math.sin(1) is returning 0.84147098.... whereas windows calc
> doing 1 then pressing sin gives me 0.017452406.....
>
> Where am I going wrong? Or can't VB add up?
>
>
>
Author
6 Jan 2006 9:01 AM
JamesB
"guy" <g**@discussions.microsoft.com> wrote in message
news:653D0FC4-C532-4116-A690-4101893BD588@microsoft.com...
> system.math.sin works in radians, the answer you got forom calculator is
> sin(1) in degrees
>
> hth
>

That would explain a lot... :)
Thanks
Author
6 Jan 2006 12:00 PM
Herfried K. Wagner [MVP]
"JamesB" <james@spamiscrappy.puffle.co.spam.uk> schrieb:
> For instance, math.sin(1) is returning 0.84147098.... whereas windows calc
> doing 1 then pressing sin gives me 0.017452406.....
>
> Where am I going wrong? Or can't VB add up?

'Math.Sin' is a .NET Framework function.  Like in VB6, mathematical
functions deal with radians.  You'll may want to convert them to degrees
using the formula presented at
<URL:http://www.tmt.com/helphtml/radtodeg_func.htm>.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>