treewars/mathutils.cpp

10 lines
192 B
C++
Raw Normal View History

#include "mathutils.h"
#include <math.h>
float MathUtils::distance(float x1, float y1, float x2, float y2)
{
float dy = y2 - y1;
float dx = x2 - x1;
return sqrt(dy*dy + dx*dx);
}