fel i math.h uniten i c++?|Programmering / Grafisk formgivning|Forum|Nordichardware

Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
The forums are currently locked and only available for read only access
sp_Feed sp_TopicIcon
fel i math.h uniten i c++?
oxiswoofer
Member
Medlem
Forum Posts: 2101
Member Since:
April 1, 2003
sp_UserOfflineSmall Offline
1
March 17, 2004 - 5:52 pm
sp_Permalink sp_Print

asså när jag använer funktionerna i math.h uniten i c++ blir resultaten fel...

har gjort följande:

double x;
Label1->Caption = sin(x);

och tex om jag x= 30
då blir svaret 6,366.......osv

men det e fel...sinus 30 skall vara 0.5...
varför blir det så? nån som vet hur man rättar till?

TERdON
Member
Medlem
Forum Posts: 2919
Member Since:
October 7, 2002
sp_UserOfflineSmall Offline
572403
March 17, 2004 - 6:27 pm
sp_Permalink sp_Print

Hmm. RTFM. Eller prova att beräkna sin(pi/6) istället. Den räknar nämligen antagligen med radianer...

EDIT: Fast det vete sjutton förresten. -1 < sin(x) < 1 < 6,nåt...

oxiswoofer
Member
Medlem
Forum Posts: 2101
Member Since:
April 1, 2003
sp_UserOfflineSmall Offline
572441
March 17, 2004 - 7:04 pm
sp_Permalink sp_Print

hm...ack...men på något sätt borde det juh gå...tycker jag..

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1030
Currently Online:
Guest(s) 520
Currently Browsing this Page:
2 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967

 

Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL