EasyGUI  Version v1.0
Mathematical

Common mathematical functions used by GUI. More...

Functions

uint8_t gui_math_sqrt (float x, float *result)
 Calculate square of input value. More...
 
uint8_t gui_math_rsqrt (float x, float *result)
 Calculate reverse square of input value. More...
 
uint8_t gui_math_distancebetweenxy (float x1, float y1, float x2, float y2, float *result)
 Calculate distance between 2 XY points. More...
 
uint8_t gui_math_centerofxy (float x1, float y1, float x2, float y2, float *resultX, float *resultY)
 Calculate center XY coordinate between 2 XY points. More...
 

Detailed Description

Common mathematical functions used by GUI.

Function Documentation

◆ gui_math_centerofxy()

uint8_t gui_math_centerofxy ( float  x1,
float  y1,
float  x2,
float  y2,
float *  resultX,
float *  resultY 
)

Calculate center XY coordinate between 2 XY points.

\(\ c_x=\frac{x_1+x_2}{2}\)

\(\ c_y=\frac{y_1+y_2}{2}\)

Parameters
[in]x1X position of point 1
[in]y1Y position of point 1
[in]x2X position of point 2
[in]y2Y position of point 2
[out]resultXPointer to float variable to store result about X position to
[out]resultYPointer to float variable to store result about Y position to
Return values
1Function succedded, results are valid
0Function failed, results are not valid

◆ gui_math_distancebetweenxy()

uint8_t gui_math_distancebetweenxy ( float  x1,
float  y1,
float  x2,
float  y2,
float *  result 
)

Calculate distance between 2 XY points.

\(\ y=sqrt{((x_1-x_2)^2+(y_1-y_2)^2)}\)

Parameters
[in]x1X position of point 1
[in]y1Y position of point 1
[in]x2X position of point 2
[in]y2Y position of point 2
[out]resultPointer to float variable to store result to
Return values
1Function succedded, result is valid
0Function failed, result is not valid

◆ gui_math_rsqrt()

uint8_t gui_math_rsqrt ( float  x,
float *  result 
)

Calculate reverse square of input value.

\(\ y=\frac{1}{sqrt{(x)}}\)

Parameters
[in]xNumber to calculate reverse square from
[out]resultPointer to float variable to store result to
Return values
1Function succedded, result is valid
0Function failed, result is not valid

◆ gui_math_sqrt()

uint8_t gui_math_sqrt ( float  x,
float *  result 
)

Calculate square of input value.

\(\ y=sqrt{(x)}\)

Parameters
[in]xNumber to calculate square from
[out]resultPointer to float variable to store result to
Return values
1Function succedded, result is valid
0Function failed, result is not valid