Skip to content

Instantly share code, notes, and snippets.

@z3t0
Created May 6, 2015 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z3t0/26bfdc9dcb6130ae0351 to your computer and use it in GitHub Desktop.
Save z3t0/26bfdc9dcb6130ae0351 to your computer and use it in GitHub Desktop.
Can't Seem to figure out what's wrong on line 12
1 void sideLengths(
2 highp float hypotenuse,
3 highp float angleInDegrees,
4 out highp float opposite,
5 out highp float adjacent) {
6
7
8 //TODO: Calculate side lengths here
9 //sin(angleInDegrees) = opposite/adjacent
10 adjacent = cos(radians(angleInDegrees)) * hypotenuse;
11 opposite = sin(radians(angleInDegrees)) * adjacent;
12 }
13
14 //Do not change this line
15 #pragma glslify: export(sideLengths)
@z3t0
Copy link
Author

z3t0 commented May 6, 2015

Solution:

adjacent = cos(radians(angleInDegrees)) * hypotenuse;
opposite = sin(radians(angleInDegrees)) * hypotenuse;

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