Skip to content

Instantly share code, notes, and snippets.

@hug0hq
Forked from patriciogonzalezvivo/GLSL-Math.md
Created November 17, 2022 16:55
Show Gist options
  • Select an option

  • Save hug0hq/e09ef0808ce62f9027c381912d2c9e96 to your computer and use it in GitHub Desktop.

Select an option

Save hug0hq/e09ef0808ce62f9027c381912d2c9e96 to your computer and use it in GitHub Desktop.
GLSL Math functions

'''

const float PI = 3.1415926535897932384626433832795; const float PI_2 = 1.57079632679489661923; const float PI_4 = 0.785398163397448309616;

float PI180 = float(PI / 180.0); float sind(float a){return sin(a * PI180);} float cosd(float a){return cos(a * PI180);}

'''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment