Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

The sinus function on a calculator, how to do in VB?

You can convert rad to deg like this

deg = PI * rad / 180.0
(Oct 26, 2014 07:57 AM)AngularJS Wrote:  So it will be like this?

Code
Dim rad As Integer
      Dim deg As Integer
      rad = Math.Sin(15.0)
      deg = Math.PI * rad / 180.0

I think you need to listen more in Maths class, this is simple math and you are getting it all wrong.
(Oct 26, 2014 08:04 AM)L-EARN Wrote:  No.

Code
Dim rad As Double
      Dim deg As Double
Dim sin As Double
      deg = 15.0
      rad = Math.PI * deg / 180.0
      sin = Math.Sin(rad)

Wrong, to convert deg to rad you do this
rad = (Math.PI / 180) * deg;

Did any of you study in school?
(Oct 26, 2014 08:10 AM)L-EARN Wrote:  Hahaha. This is THE SAME THING.

(Math.PI / 180) deg
Is the same thing as :

(Math.PI
deg) / 180

This thread is a f***** joke ...

"(Math.PI / 180) * val" is how I always do it and how everybody I know does it, I didn't even read your post, just saw it wasn't the clean/my way of doing it, so I assumed it was wrong

Your way does work, sorry for not reading I guess xD


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by FhackMar 2, 2022 03:52 AM 4 306 Mar 2, 2022 03:52 AM
Last Post: Fhack
[.NET] by CynnNov 6, 2014 06:17 AM 7 199 Nov 6, 2014 06:17 AM
Last Post: Cynn
[Python] by success = trueSep 14, 2013 07:05 PM 3 123 Sep 14, 2013 07:05 PM
Last Post: Dmaster_773