Where Can I Find C++ Mathematical #Includes for Common Functions?

  • Context: C/C++ 
  • Thread starter Thread starter davidbenari
  • Start date Start date
  • Tags Tags
    C++ Mathematical
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 1K views
davidbenari
Messages
466
Reaction score
18
I've just begun learning c++ and what is very different from MATLAB (e.g.) is that one has to use include files.

I was wondering if there's somewhere I can download mathematical #includes which already has stuff like matrix inverses, trigonometric functions, etc, defined.

I think numerical recipes has something like that, but you have to pay.

In python one usually uses scipy, numpy and similar stuff. But what do people that use c++ do?
 
Physics news on Phys.org
Trig functions are included in the standard C99 libraries:

Code:
#include <cmath>
#include <cstdio>

int main(int, char**){
     printf("Sin of pi: %f", sin(3.14));
     return 0;
}
 
  • Like
Likes   Reactions: davidbenari