util.rst 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .. default-domain:: C
  2. utils / helpers
  3. ================================================================================
  4. Header: cglm/util.h
  5. Table of contents (click to go):
  6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. Functions:
  8. 1. :c:func:`glm_sign`
  9. #. :c:func:`glm_rad`
  10. #. :c:func:`glm_deg`
  11. #. :c:func:`glm_make_rad`
  12. #. :c:func:`glm_make_deg`
  13. #. :c:func:`glm_pow2`
  14. Functions documentation
  15. ~~~~~~~~~~~~~~~~~~~~~~~
  16. .. c:function:: int glm_sign(int val)
  17. | returns sign of 32 bit integer as +1 or -1
  18. Parameters:
  19. | *[in]* **val** an integer
  20. Returns:
  21. sign of given number
  22. .. c:function:: float glm_rad(float deg)
  23. | convert degree to radians
  24. Parameters:
  25. | *[in]* **deg** angle in degrees
  26. .. c:function:: float glm_deg(float rad)
  27. | convert radians to degree
  28. Parameters:
  29. | *[in]* **rad** angle in radians
  30. .. c:function:: void glm_make_rad(float *degm)
  31. | convert exsisting degree to radians. this will override degrees value
  32. Parameters:
  33. | *[in, out]* **deg** pointer to angle in degrees
  34. .. c:function:: void glm_make_deg(float *rad)
  35. | convert exsisting radians to degree. this will override radians value
  36. Parameters:
  37. | *[in, out]* **rad** pointer to angle in radians
  38. .. c:function:: float glm_pow2(float x)
  39. | multiplies given parameter with itself = x * x or powf(x, 2)
  40. Parameters:
  41. | *[in]* **x** value
  42. Returns:
  43. square of a given number
  44. .. c:function:: float glm_min(float a, float b)
  45. | returns minimum of given two values
  46. Parameters:
  47. | *[in]* **a** number 1
  48. | *[in]* **b** number 2
  49. Returns:
  50. minimum value
  51. .. c:function:: float glm_max(float a, float b)
  52. | returns maximum of given two values
  53. Parameters:
  54. | *[in]* **a** number 1
  55. | *[in]* **b** number 2
  56. Returns:
  57. maximum value