Physics4K  2013-06-04
Physics4K is the next great evolution in 2D physics engines. built upon the C++ Game Framework, it is going to take the next generation gaming world by storm.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
MathXtras.h
Go to the documentation of this file.
1 // Filename: MathXtras.h
4 
5 //Preprocessor directive designed to cause the current source file to be included only once in a single compilation
6 #pragma once
7 
8 //Includes
9 #include "Vector2f.h"
10 #include "Matrix22.h"
11 
12 const float TWO_PI = 6.283185307179586476925286766559f;
13 
14 using namespace PK;
15 
16 namespace PK
17 {
18  Vector2f Abs(const Vector2f& value);
19  Matrix22 Abs(const Matrix22& value);
20  float Sign(float x);
21  float Dot(const Vector2f& a, const Vector2f& b);
22  Vector2f Tangent(const Vector2f& vector);
23  float Cross(const Vector2f& v1, const Vector2f& v2);
24  float Clamp(float value, const float min, const float max);
25  unsigned int Factorial(unsigned int n);
26  unsigned int TriangleNumber(unsigned int n);
27  float FastInvSqrt(float n);
28  float FastSqrt(float n);
29 }