|
EasyGUI
|
Common mathematical functions used by GUI. More...
Functions | |
| uint8_t | gui_math_sqrt (float x, float *const result) |
| Calculate square of input value. More... | |
| uint8_t | gui_math_rsqrt (float x, float *const result) |
| Calculate reverse square of input value. More... | |
| uint8_t | gui_math_distancebetweenxy (float x1, float y1, float x2, float y2, float *const result) |
| Calculate distance between 2 XY points. More... | |
| uint8_t | gui_math_centerofxy (float x1, float y1, float x2, float y2, float *const resultx, float *const resulty) |
| Calculate center XY coordinate between 2 XY points. More... | |
Common mathematical functions used by GUI.
| uint8_t gui_math_centerofxy | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float *const | resultx, | ||
| float *const | 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}\)
| [in] | x1 | X position of point 1 |
| [in] | y1 | Y position of point 1 |
| [in] | x2 | X position of point 2 |
| [in] | y2 | Y position of point 2 |
| [out] | resultx | Pointer to float variable to store result about X position to |
| [out] | resulty | Pointer to float variable to store result about Y position to |
1 on success, 0 otherwise | uint8_t gui_math_distancebetweenxy | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float *const | result | ||
| ) |
Calculate distance between 2 XY points.
\(\ y=sqrt{((x_1-x_2)^2+(y_1-y_2)^2)}\)
| [in] | x1 | X position of point 1 |
| [in] | y1 | Y position of point 1 |
| [in] | x2 | X position of point 2 |
| [in] | y2 | Y position of point 2 |
| [out] | result | Pointer to float variable to store result to |
1 on success, 0 otherwise | uint8_t gui_math_rsqrt | ( | float | x, |
| float *const | result | ||
| ) |
Calculate reverse square of input value.
\(\ y=\frac{1}{sqrt{(x)}}\)
| [in] | x | Number to calculate reverse square from |
| [out] | result | Pointer to float variable to store result to |
1 on success, 0 otherwise | uint8_t gui_math_sqrt | ( | float | x, |
| float *const | result | ||
| ) |
Calculate square of input value.
\(\ y=sqrt{(x)}\)
| [in] | x | Number to calculate square from |
| [out] | result | Pointer to float variable to store result to |
1 on success, 0 otherwise