473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

math wrong?

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?
Jan 6 '06 #1
3 1903
guy
system.math.sin works in radians, the answer you got forom calculator is
sin(1) in degrees

hth

guy

"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?

Jan 6 '06 #2

"guy" <gu*@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.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
Jan 6 '06 #3
"JamesB" <ja***@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/>

Jan 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Frank Millman | last post by:
Hi all I was helping my niece with her trigonometry homework last night. Her calculator's batteries were flat, so I thought I would use Python's math module to calculate sin, cos, and tan. I...
5
by: Ark | last post by:
Hi everyone, Does anyone know if Direct3D overloads System.Math functions? Also is it possible to access the base functions of the overloaded function (in other words restore original of the...
4
by: Typpo | last post by:
Hi, Maybe I'm missing something: <begin code> MessageBox.Show("a = " + a + ", b = " + c + ", c = " + c); //message 1 double top = (Math.Pow(a, 2) + Math.Pow(b, 2) - Math.Pow(c, 2)); double...
110
by: Gregory Pietsch | last post by:
I'm writing a portable implementation of the C standard library for http://www.clc-wiki.net and I was wondering if someone could check the functions in math.h for sanity/portability/whatever. I'm...
5
by: Vedran Furač | last post by:
I think that this results must be the same: In : math.atan2(-0.0,-1) Out: -3.1415926535897931 In : math.atan2(-0,-1) Out: 3.1415926535897931 In : -0 == -0.0 Out: True
6
by: Zeng | last post by:
Math.Round has good behavior as following: Math.Round(3.45, 1); //Returns 3.4. The last '5' is thrown away because 4 is even Math.Round(3.75, 1); //Returns 3.8. The last '5' is used because '7'...
5
by: matthias s | last post by:
Hi there, I believed that Math.Ceiling is like Math.Round except that it always rounds up to the next but this double d = Math.Ceiling(29/15);
4
by: =?Utf-8?B?UmVuZQ==?= | last post by:
Hello everyone I have a problem with Math.Round, it´s ocurring some strange: Math.Round(12.985) = 12.98, it´s wrong. It should be: 12.99 Why?? What is the problem? Help ME !!!!
5
by: Nondisclosure007 | last post by:
Hello. If this is the wrong group for this, please let me know. I'll post it somewhere else. I've been doing data imports into MS Excel (ver 2007) and using the CORREL function. What I was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.