Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 C++ Function crash
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Tue Jul 08, 2003 8:48 pm   Post subject: C++ Function crash

can some1 tell me why this function crashes?
code:
float cosd(float x){
        return cos((3.141592653*x)/180);
}
float sind(float x){
        return sind((3.141592653*x)/180);
}

void rotate (float OriginX,float OriginY, float &secondpartX,float &secondpartY,float Rotaion){
    float tempx = (((OriginX - secondpartX) * cosd (Rotaion)) + ((OriginY - secondpartY) * sind (Rotaion)));
    float tempy = (((OriginY - secondpartY) * cosd (Rotaion)) - ((OriginX - secondpartX) * sind (Rotaion)));
    secondpartY = OriginY - tempy;
    secondpartX = OriginX - tempx;
}
Sponsor
Sponsor
Sponsor
sponsor
Catalyst




PostPosted: Tue Jul 08, 2003 9:06 pm   Post subject: Re: C++ Function crash

Homer_simpson wrote:
can some1 tell me why this function crashes?
code:

        return sind((3.141592653*x)/180);


should be sin
Homer_simpson




PostPosted: Tue Jul 08, 2003 9:41 pm   Post subject: (No subject)

oh yeah... oops Embarassed
stupid C++ can be really confusing sometimes... Razz
thx for the help catalyst... Very Happy
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: