Last active
September 13, 2019 23:31
-
-
Save katsaii/f57707ed662ff82a55e5b9f5af4b934c to your computer and use it in GitHub Desktop.
Calculates a triangle wave at a specific phase in radians.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gml_pragma("forceinline"); | |
/// @desc Calculates a triangle wave. | |
/// @param angle {Real} The angle in degrees to consider. | |
return tri(degtorad(argument0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gml_pragma("forceinline"); | |
/// @desc Calculates a triangle wave. | |
/// @param radian_angle {Real} The angle in radians to consider. | |
var pheta = argument0 / 2 / pi - 0.25; | |
return 1 - 4 * abs(round(pheta) - pheta); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment