113 int32_t
leMini(int32_t l, int32_t r);
140 int32_t
leMaxi(int32_t l, int32_t r);
167 float leMinf(
float l,
float r);
194 float leMaxf(
float l,
float r);
225 int32_t
leClampi(int32_t min, int32_t max, int32_t i);
255 float leClampf(
float min,
float max,
float f);
287 uint32_t
lePercent(uint32_t l, uint32_t r);
351 uint32_t
lePercentOf(uint32_t num, uint32_t percent);
383 void lePercentOfDec(uint32_t num, uint32_t percent, uint32_t* whl, uint32_t* dec);
416 uint32_t
leScaleInteger(uint32_t num, uint32_t oldMax, uint32_t newMax);
504 int32_t
leLerp(int32_t x, int32_t y, uint32_t per);
622 int32_t
leSin(int32_t v);
652 int32_t
leCos(int32_t v);
710 double leAtan(
double val);
980 float leSqrt(
const float x);
982 void lePointOnCircle(uint32_t radius,
986 uint32_t leDegreesFromPercent(uint32_t percent,
990 uint32_t lePercentFromDegrees(uint32_t degrees,
994 void leNormalizeAngles(int32_t startAngle,
996 int32_t* normalizedStartAngle,
997 int32_t* normalizedEndAngle);
1001 uint32_t angleCount;
1016 void leResolveAngles(int32_t startAngle,
1020 float leRound(
float flt);
int32_t leClampi(int32_t min, int32_t max, int32_t i)
Calculates clamp of an integer.
Definition: legato_math.c:171
Definition: legato_math.h:84
leResult leEllipsePoint(int32_t t, int32_t a, int32_t b, int32_t theta, lePoint *p)
Calculates points in an arc.
Definition: legato_math.c:132
Common macros and definitions used by Legato.
int32_t leScaleIntegerSigned(int32_t num, int32_t oldMax, int32_t newMax)
Calculate the scale of signed integer.
Definition: legato_math.c:245
leResult lePolarToXY(int32_t r, int32_t a, lePoint *p)
Generate points in an arc.
Definition: legato_math.c:124
void leRotatePoint(lePoint pos, lePoint org, int32_t ang, lePoint *res)
Rotates point.
Definition: legato_math.c:452
leArcDir
Used to define arc direction.
Definition: legato_math.h:82
int32_t leMaxi(int32_t l, int32_t r)
Calculate maximum of two integers.
Definition: legato_math.c:156
int32_t leGetXGivenYOnLine(lePoint p1, lePoint p2, int32_t y)
Project point.
Definition: legato_math.c:436
uint32_t lePercentOf(uint32_t num, uint32_t percent)
Calculate percent of a number.
Definition: legato_math.c:218
int32_t leDivideRounding(int32_t num, int32_t denom)
Performs a linear interpolation of an integer based on a percentage between two signed points...
Definition: legato_math.c:328
void leRotatedRectBounds(leRect rect, int32_t ang, leRect *res)
Calculate bounding rectangle.
Definition: legato_math.c:472
leResult
This enum represents function call results.
Definition: legato_common.h:123
float leMinf(float l, float r)
Calculate minimum of two floats.
Definition: legato_math.c:161
uint32_t lePercentWholeRounded(uint32_t l, uint32_t r)
Calculate percent whole rounded.
Definition: legato_math.c:204
Definition: legato_math.h:85
int32_t leLerp(int32_t x, int32_t y, uint32_t per)
Calculates a linear interpolation of an integer based on a percentage between two signed points...
Definition: legato_math.c:290
This struct represents a rectangle.
Definition: legato_common.h:394
void leSortPointsY(lePoint *p1, lePoint *p2)
Sorts two points on the Y axis.
Definition: legato_math.c:424
int32_t leMini(int32_t l, int32_t r)
Calculate minimum of two integers.
Definition: legato_math.c:151
Definition: legato_math.h:999
void lePercentOfDec(uint32_t num, uint32_t percent, uint32_t *whl, uint32_t *dec)
Calculate percent of a decimal.
Definition: legato_math.c:231
Definition: legato_math.h:712
uint32_t leAbsoluteValue(int32_t val)
Calculates the absolute value of a signed integer.
Definition: legato_math.c:280
int32_t leCos(int32_t v)
Calculate cosine of a number.
Definition: legato_math.c:93
void leSortPointsX(lePoint *p1, lePoint *p2)
Sorts two points on the X axis.
Definition: legato_math.c:412
int32_t leSin(int32_t v)
Calculate sin of a number.
Definition: legato_math.c:64
This structure represents a integer Cartesian point.
Definition: legato_common.h:346
LE_QUADRANT
Used to define the basic four quandrants of a coordinate plane.
Definition: legato_math.h:70
uint32_t leScaleInteger(uint32_t num, uint32_t oldMax, uint32_t newMax)
Calculate the scale of an integer.
Definition: legato_math.c:256
leBool
This enum represents booleans.
Definition: legato_common.h:146
uint32_t lePercent(uint32_t l, uint32_t r)
Calculate percent of number.
Definition: legato_math.c:199
int32_t leNormalizeAngle(int32_t t)
Normalize an angle between 0 - 360.
Definition: legato_math.c:49
int32_t leGetYGivenXOnLine(lePoint p1, lePoint p2, int32_t x)
Project Y give X.
Definition: legato_math.c:444
float leMaxf(float l, float r)
Calculate maximum of two floats.
Definition: legato_math.c:166
float leClampf(float min, float max, float f)
Calculate clamp of a float.
Definition: legato_math.c:185
LE_TRIG_FUNCTION_TYPE
Used to define the types of trig functions.
Definition: legato_math.h:60
double leAtan(double val)
Calculate atan of points.
Definition: legato_math.c:145