Computer Science Canada

C++ Function crash

Author:  Homer_simpson [ 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;
}

Author:  Catalyst [ 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

Author:  Homer_simpson [ Tue Jul 08, 2003 9:41 pm ]
Post subject: 

oh yeah... oops Embarassed
stupid C++ can be really confusing sometimes... Razz
thx for the help catalyst... Very Happy


: