Can someone tell me which header file i need to use with this code. i am getting an error when i compile it. Thanks. My include consist of #include <iostream> and #include <math.h> in my header files. I am using Visual C++ 2008 Express edition.
Your error has nothing to do with header files. It says exactly what's wrong.
error C2864: 'RtTriangle::PI' : only staticconst integral data members can be initialized within a class
The keyword being "integral". You can't initialize the PI member inside of the class because it's a floating point number. You need to do one of the following:
1.) Make it non-const and initialize it in a constructor.
2.) Make it global.
But there's no point in doing either of those things, because math.h has the M_PI constant.
But since you mentioned headers... as a C++ programmer, you should be using <cmath> instead of <math.h>.
cmath.h also has the M_PI constant.