🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #5943

Re: Kan java rekenen ?

#5943
From: Haplo
Date: Wed, 19 Feb 2003 22:16
44 lines
2663 bytes
In article <3e53fd7c$0$23366$afc38c87@sisyphus.news.be.easynet.net>, 
ikke@hier.be says...
> Beste,
> 
> Bij mij geeft volgend java programma:
> 
> import java.lang.Math;
> public class Test {
>         public static void main(String[] args) {
>                 System.out.println("Sinus of 00 = " + Math.sin(0d));
>                 System.out.println("Sinus of 30 = " + Math.sin(30d));
>                 System.out.println("Sinus of 60 = " + Math.sin(60d));
>                 System.out.println("Sinus of 90 = " + Math.sin(90d));
>                 System.out.println("Cos of 00 = " + Math.cos(0d));
>                 System.out.println("Cos of 30 = " + Math.cos(30d));
>                 System.out.println("Cos of 60 = " + Math.cos(60d));
>                 System.out.println("Cos of 90 = " + Math.cos(90d));
>         }
> }
> 
> volgende output:
> 
> [root@cook javaprog]# java Test
> Sinus of 00 = 0.0
> Sinus of 30 = -0.9880316240928618
> Sinus of 60 = -0.3048106211022167
> Sinus of 90 = 0.8939966636005579
> Cos of 00 = 1.0
> Cos of 30 = 0.15425144988758405
> Cos of 60 = -0.9524129804151563
> Cos of 90 = -0.4480736161291701
> 
> Er zijn veel rekenmachine's die daar anders over denken ... Where's the 
> catch ?
> 
> nb: Ik probeerde het ook met door de waarden als 30.0e0 te schrijven, of 
> door eerst een variabele van het type double te definieren en die te 
> gebruiken in de berekening, altijd hetzelfde.

Math.sin en Math.cos hebben een waarde in radialen als input parameter. 
Dus niet in graden. Je zult je waarden eerst naar radialen moeten 
omzetten met Math.toRadians.

Haplo
Technical Details
Message-ID: <MPG.18be20a5f0ba0541989694@news.telenet.be>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!proxad.net!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
References: <3e53fd7c$0$23366$afc38c87@sisyphus.news.be.easynet.net>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: fcea4,dcaf351d0f71681f
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2003-02-19 14:17:42 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!proxad.net!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
From: Haplo <valgaeren@nospam.invalid>
Newsgroups: be.comp.programming
Subject: Re: Kan java rekenen ?
Message-ID: <MPG.18be20a5f0ba0541989694@news.telenet.be>
References: <3e53fd7c$0$23366$afc38c87@sisyphus.news.be.easynet.net>
Organization: Monkey Business
Reply-To: Wim.Valgaeren@pandora.be
X-Newsreader: MicroPlanet Gravity v2.60
Lines: 44
Date: Wed, 19 Feb 2003 22:16:23 GMT
NNTP-Posting-Host: 195.130.137.248
X-Complaints-To: abuse@telenet.be
X-Trace: afrodite.telenet-ops.be 1045692983 195.130.137.248 (Wed, 19 Feb 2003 23:16:23 MET)
NNTP-Posting-Date: Wed, 19 Feb 2003 23:16:23 MET