Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: CosT(X) and SinT(X) result in crash when X>180 ? (VC++)  (Read 1643 times)
zaky
Community Member
*
Posts: 28


« on: December 28, 2006, 07:01:47 PM »

CamX = (HeroX - DistCamHero) * pGlobals->SinT( CamRotY );
CamZ = (HeroZ - DistCamHero) * pGlobals->CosT( CamRotY );
if  CamRotY > 180  there's a Runtime Error (abnormal program termination) and program quits.

hmmm
Logged
Rynus_Rein
Community Member
*
Posts: 1010


« Reply #1 on: December 29, 2006, 03:38:30 AM »

as far as I remember from my math classes, you can't get the sinus of >= 180 degrees?
Logged

Rynus Rein
Current Project: MapX Live, Society3D
zaky
Community Member
*
Posts: 28


« Reply #2 on: December 29, 2006, 08:07:47 AM »

oh, i thought that's the reason, but i thought you can because i checked it with windows calucator Tongue
Logged
mathijs
Community Member
*
Posts: 369


« Reply #3 on: December 29, 2006, 09:36:42 AM »

Quote from: "Rynus_Rein"
as far as I remember from my math classes, you can't get the sinus of >= 180 degrees?


Thats tan eh? sin should work from -infinite to infinite afaik.
Logged
Turael
Community Member
*
Posts: 25


« Reply #4 on: December 29, 2006, 10:47:17 AM »

sin IS available for -infinity -> +infinity
Logged
zaky
Community Member
*
Posts: 28


« Reply #5 on: December 29, 2006, 12:42:51 PM »

so what's with the function
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2674


WWW
« Reply #6 on: December 29, 2006, 02:42:59 PM »

SinT/CosT disappered in version 6.5. So just don't use it, use your language's math functions... In .NET you'll want to use
double System.Math.Sin(double);
and
double System.Math.Cos(double);
Logged

zaknafein.
>> the instruction limit : my blog & samples repository! <<
Rynus_Rein
Community Member
*
Posts: 1010


« Reply #7 on: December 30, 2006, 05:50:42 AM »

it's so said that .Net uses doubles in their Math library, and TV float. So many ugly casts ;-(
Logged

Rynus Rein
Current Project: MapX Live, Society3D
zaky
Community Member
*
Posts: 28


« Reply #8 on: December 30, 2006, 04:06:20 PM »

oh damn.
is there any way to tell VC++6 "search the code and change pGlobals->SinT to cosf"?

edit:
hmm, cosf takes radians, is there any function that takes degrees? (too lazy adding * (3.14 / 180) to 3910413 places in code)..
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks