/******************************************************************************
This source file is part of Viewizard Game Engine
For the latest info, see http://www.viewizard.com/
File name: Math.h
Copyright (c) 2001-2007 Michael Kurinnoy, Viewizard
All Rights Reserved.
File Version: 3.0
******************************************************************************
AstroMenace game source code available under "dual licensing" model.
The licensing options available are:
* Commercial Licensing. This is the appropriate option if you are
creating proprietary applications and you are not prepared to
distribute and share the source code of your application.
Contact us for pricing at viewizard@viewizard.com
* Open Source Licensing. This is the appropriate option if you want
to share the source code of your application with everyone you
distribute it to, and you also want to give them the right to share
who uses it. You should have received a copy of the GNU General Public
License version 3 with this source codes.
If not, see .
******************************************************************************/
#ifndef CoreMath_H
#define CoreMath_H
#include "../Base.h"
// Get cosine
double vw_dcos(int Angle);
// Get sine
double vw_dsin(int Angle);
// быстрый sqrtf
float vw_sqrtf(float x);
// быстрое сравнение строк (по аналогии с strcmp)
int vw_strcmp(const char *a, const char *b);
// rand
float vw_Rand();
float vw_RandNum(float Max);
int vw_iRandNum(int Max);
// RANDOM_NUM возвращает значение -1.0f - 1.0f, стремится к нулю (!)
#define vw_Randf0 ((vw_Rand()-vw_Rand())/RAND_MAX)
// RANDOM_NUM2 возвращает значение 0.0f - 1.0f
#define vw_Randf1 (vw_Rand()/RAND_MAX) //(fmodf(vw_Rand(),100.0f)/100.0f)
// Полезный макрос, гарантирует что в пределах
#define Clamp(x, min, max) x = (x