三角関数(js,GLSL,HLSL)
code:triangle.js
Math.PI
Math.sin(x)
Math.cos(x)
Math.tan(x)
Math.asin(x) // y = sin(x), x = asin(y)
Math.acos(x) // y = cos(x), x = acos(y)
Math.atan(x)
Math.atan2(y, x)
Math.sinh(x)
Math.cosh(x)
Math.tanh(x)
Math.asinh(x)
Math.acosh(x)
Math.atanh(x)
code:triangle.GLSL
const float PI = 3.1415926;
sin(x)
cos(x)
tan(x)
asin(x)
acos(x)
atan(y, x) // -2PI to 2PI
atan(a) // a = y/x, -PI/2 to PI/2
sinh(x)
cosh(x)
tanh(x)
asinh(x)
acosh(x)
atanh(x)
code:triangle.HLSL
static float PI = 3.1415926;
sin(x)
cos(x)
tan(x)
asin(x)
acos(x)
atan(x)
atan2(y, x)
sinh(x)
cosh(x)
tanh(x)
// HLSLではasinh,acosh,atanh関数がない