Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/++/# C++ mathematical #include's

  1. Jul 7, 2016 #1
    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 theres 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?
     
  2. jcsd
  3. Jul 8, 2016 #2
  4. Jul 8, 2016 #3
    Trig functions are included in the standard C99 libraries:

    Code (C):
    #include <cmath>
    #include <cstdio>

    int main(int, char**){
         printf("Sin of pi: %f", sin(3.14));
         return 0;
    }
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: C++ mathematical #include's
Loading...