X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2Fmathw.cpp;h=830a33dd7fc2052752b60e9656fa900522cdb0fe;hb=9ae1c0798cff2d1ed816bccb0723bd5a4ca97194;hp=c25df989476471e7be2c63bdb4d241a69c3a8209;hpb=ad9f1fb6bdfc51df61a7fb52d607ca0c0bceca4c;p=physics.git diff --git a/src/mathw.cpp b/src/mathw.cpp index c25df98..830a33d 100644 --- a/src/mathw.cpp +++ b/src/mathw.cpp @@ -1,9 +1,21 @@ -#include "mathw.h" - +/* + * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ -/// ***** Private Varibles ***** - -const float PI = 3.141592653; +#include "mathw.h" /// ***** Public Methods ***** @@ -13,22 +25,7 @@ int mod(int x, int y) return x % y + (x < 0 ? y : 0); } -float radsToA(float rads) -{ - return ftofix(rads * 128/PI); -} - -float atanA(float c) -{ - return radsToA(atan(c)) + itofix(64); -} - -float atan2A(float y, float x) -{ - return radsToA(atan2(y,x)) + itofix(64); -} - -/// Vector2 Math +// Vector2 Math Vector2 perp(const Vector2& vec) {