---
title: "Extra Math Functions/Macros"
source: https://github.com/obs-rust/obs-studio/blob/524486a44c81ef30b039f10ab955bc778f39e225/docs/sphinx/reference-libobs-graphics-math.rst
commit: 524486a44c81ef30b039f10ab955bc778f39e225
tier: reference
tokens_est: 158
---
# Extra Math Functions/Macros

.. code:: cpp

   #include <graphics/math-extra.h>

Helper functions/macros for graphics math.


`RAD(val)`

   Macro that converts a floating point degrees value to radians.


`DEG(val)`

   Macro that converts a floating point radians value to degrees.

**LARGE_EPSILON**   1e-2f

   Large epsilon value.

**EPSILON**         1e-4f

   Epsilon value.

**TINY_EPSILON**    1e-5f

   Tiny Epsilon value.

**M_INFINITE**      3.4e38f

   Infinite value



`float rand_float(int positive_only)`

   Generates a random floating point value (from -1.0f..1.0f, or
   0.0f..1.0f if *positive_only* is set).
