![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
ALMaSS_MathFuncs constructor. More...
#include <Misc.h>
Public Member Functions | |
ALMaSS_MathFuncs () | |
ALMaSS_MathFuncs constructor. More... | |
virtual | ~ALMaSS_MathFuncs () |
ALMaSS_MathFuncs deconstructor. More... | |
int | CalcDistPythagoras (int a_x, int a_y, int a_x1, int a_y1) |
Calculate distance using Pythagoras. More... | |
int | CalcDistPythagorasApprox (int a_x, int a_y, int a_x1, int a_y1) |
Calculate distance using the Pythagoras approximation. More... | |
ALMaSS_MathFuncs constructor.
|
inline |
ALMaSS_MathFuncs constructor.
This class is designed to hold general math functions frequently used in the ALMaSS code. For example distance calculations using either Pythagoras or the approximation of Pythagoras
|
inlinevirtual |
ALMaSS_MathFuncs deconstructor.
int ALMaSS_MathFuncs::CalcDistPythagoras | ( | int | a_x, |
int | a_y, | ||
int | a_x1, | ||
int | a_y1 | ||
) |
int ALMaSS_MathFuncs::CalcDistPythagorasApprox | ( | int | a_x, |
int | a_y, | ||
int | a_x1, | ||
int | a_y1 | ||
) |
Calculate distance using the Pythagoras approximation.
The approximation to Pythagorus is accurate to around 6%