mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-13 09:02:10 +00:00
59 lines
887 B
Plaintext
59 lines
887 B
Plaintext
float PI = 3.14159265358979
|
|
float EulersNumber = 2.71828183
|
|
|
|
float Sin(float input)
|
|
{
|
|
print input
|
|
float out = CPP.Math.Sin(input)
|
|
return out
|
|
}
|
|
|
|
float Cos(float input)
|
|
{
|
|
float out = CPP.Math.Cos(input)
|
|
return out
|
|
}
|
|
|
|
float Tan(float input)
|
|
{
|
|
float out = CPP.Math.Tan(input)
|
|
return out
|
|
}
|
|
|
|
float Sigmoid(float input)
|
|
{
|
|
float out = 1 / (1+EulersNumber^-input)
|
|
return out
|
|
}
|
|
|
|
float Tanh(float input)
|
|
{
|
|
float out = ((EulersNumber^input)-(EulersNumber^-input))/((EulersNumber^input)+(EulersNumber^-input))
|
|
return out
|
|
}
|
|
|
|
float Round(float input)
|
|
{
|
|
float out = CPP.Math.Round(input)
|
|
return out
|
|
}
|
|
|
|
float Clamp(float input, float min, float max)
|
|
{
|
|
if input < min
|
|
{
|
|
return min
|
|
}
|
|
if input > max
|
|
{
|
|
return max
|
|
}
|
|
return input
|
|
}
|
|
|
|
// Sets color of pixel to RGB value
|
|
float SetPixel(int x, int y, int r, int g, int b)
|
|
{
|
|
string out = CPP.Graphics.SetPixel(x, y, r, g, b)
|
|
return out
|
|
} |