Advertisement
tehcmn

math.h

Apr 6th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #ifndef _MATH_H
  2. #define _MATH_H
  3.  
  4. inline float array_min(float *a);
  5. inline float array_max(float *a);
  6. inline double fsqrt(const double d);
  7. inline double facos(const float x);
  8.  
  9. class Point
  10. {
  11.     public:
  12.         Point();
  13.         Point(float, float);
  14.         float x;
  15.         float y;   
  16. };
  17.  
  18. class Line
  19. {
  20.     public:
  21.         Line(Point&, Point&);
  22.         Line(float, float, float, float);
  23.         Point start;
  24.         Point end;
  25.         Point intersection;
  26.         bool Intersects(const Line& l);
  27. };
  28.  
  29. class Vector2
  30. {
  31.     public:
  32.         Vector2();
  33.         Vector2(float, float);
  34.         Vector2 operator+(const Vector2& v) const;
  35.         Vector2 operator-(const Vector2& v) const;
  36.         float operator*(const Vector2& v) const;
  37.         Vector2 operator*(const float f) const;
  38.         float Length();
  39.         Vector2 Normal();
  40.         Vector2 Perpendicular();
  41.         float Angle(const Vector2& v);
  42.         float x;
  43.         float y;
  44. };
  45.  
  46.  
  47. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement