Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.2 KiB

  1. /* -----------------------------------------------------------------------------
  2. * See the LICENSE file for information on copyright, usage and redistribution
  3. * of SWIG, and the README file for authors - http://www.swig.org/release.html.
  4. *
  5. * math.i
  6. *
  7. * SWIG library file for floating point operations.
  8. * ----------------------------------------------------------------------------- */
  9. %module math
  10. %{
  11. #include <math.h>
  12. %}
  13. extern double cos(double x);
  14. /* Cosine of x */
  15. extern double sin(double x);
  16. /* Sine of x */
  17. extern double tan(double x);
  18. /* Tangent of x */
  19. extern double acos(double x);
  20. /* Inverse cosine in range [-PI/2,PI/2], x in [-1,1]. */
  21. extern double asin(double x);
  22. /* Inverse sine in range [0,PI], x in [-1,1]. */
  23. extern double atan(double x);
  24. /* Inverse tangent in range [-PI/2,PI/2]. */
  25. extern double atan2(double y, double x);
  26. /* Inverse tangent of y/x in range [-PI,PI]. */
  27. extern double cosh(double x);
  28. /* Hyperbolic cosine of x */
  29. extern double sinh(double x);
  30. /* Hyperbolic sine of x */
  31. extern double tanh(double x);
  32. /* Hyperbolic tangent of x */
  33. extern double exp(double x);
  34. /* Natural exponential function e^x */
  35. extern double log(double x);
  36. /* Natural logarithm ln(x), x > 0 */
  37. extern double log10(double x);
  38. /* Base 10 logarithm, x > 0 */
  39. extern double pow(double x, double y);
  40. /* Power function x^y. */
  41. extern double sqrt(double x);
  42. /* Square root. x >= 0 */
  43. extern double fabs(double x);
  44. /* Absolute value of x */
  45. extern double ceil(double x);
  46. /* Smallest integer not less than x, as a double */
  47. extern double floor(double x);
  48. /* Largest integer not greater than x, as a double */
  49. extern double fmod(double x, double y);
  50. /* Floating-point remainder of x/y, with the same sign as x. */
  51. #define M_E 2.7182818284590452354
  52. #define M_LOG2E 1.4426950408889634074
  53. #define M_LOG10E 0.43429448190325182765
  54. #define M_LN2 0.69314718055994530942
  55. #define M_LN10 2.30258509299404568402
  56. #define M_PI 3.14159265358979323846
  57. #define M_PI_2 1.57079632679489661923
  58. #define M_PI_4 0.78539816339744830962
  59. #define M_1_PI 0.31830988618379067154
  60. #define M_2_PI 0.63661977236758134308
  61. #define M_2_SQRTPI 1.12837916709551257390
  62. #define M_SQRT2 1.41421356237309504880
  63. #define M_SQRT1_2 0.70710678118654752440