mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-11 16:22:12 +00:00
Updated to new function syntax
This commit is contained in:
parent
83404f266f
commit
1cc2e9abe7
@ -4,7 +4,7 @@ float PI = 3.14159265358979
|
||||
float EulersNumber = 2.71828183
|
||||
|
||||
// Trigonometric function Sin
|
||||
float Sin(float input)
|
||||
func Sin(input)
|
||||
{
|
||||
print input
|
||||
float out = CPP.Math.Sin(input)
|
||||
@ -12,42 +12,42 @@ float Sin(float input)
|
||||
}
|
||||
|
||||
// Trigonometric function Cos
|
||||
float Cos(float input)
|
||||
func Cos(input)
|
||||
{
|
||||
float out = CPP.Math.Cos(input)
|
||||
return out
|
||||
}
|
||||
|
||||
// Trigonometric function Tan
|
||||
float Tan(float input)
|
||||
func Tan(input)
|
||||
{
|
||||
float out = CPP.Math.Tan(input)
|
||||
return out
|
||||
}
|
||||
|
||||
// Sigmoid activation function
|
||||
float Sigmoid(float input)
|
||||
func Sigmoid(input)
|
||||
{
|
||||
float out = 1 / (1+EulersNumber^-input)
|
||||
return out
|
||||
}
|
||||
|
||||
// Hyperbolic tangent activation function
|
||||
float Tanh(float input)
|
||||
func Tanh(input)
|
||||
{
|
||||
float out = ((EulersNumber^input)-(EulersNumber^-input))/((EulersNumber^input)+(EulersNumber^-input))
|
||||
return out
|
||||
}
|
||||
|
||||
// Rounds input to nearest integer value
|
||||
float Round(float input)
|
||||
func Round(input)
|
||||
{
|
||||
float out = CPP.Math.Round(input)
|
||||
return out
|
||||
}
|
||||
|
||||
// Clamps input between min and max
|
||||
float Clamp(float input, float min, float max)
|
||||
func Clamp(input, min, max)
|
||||
{
|
||||
if input < min
|
||||
{
|
||||
@ -61,21 +61,21 @@ float Clamp(float input, float min, float max)
|
||||
}
|
||||
|
||||
// Sets color of pixel to RGB value
|
||||
float SetPixel(int x, int y, int r, int g, int b)
|
||||
func SetPixel(x, y, r, g, b)
|
||||
{
|
||||
string out = CPP.Graphics.SetPixel(x, y, r, g, b)
|
||||
return out
|
||||
}
|
||||
|
||||
// Prints input value to console
|
||||
float Print(string in)
|
||||
func Print(in)
|
||||
{
|
||||
string out = CPP.System.Print(in)
|
||||
return out
|
||||
}
|
||||
|
||||
// Prints input value to console with appended newline '\n'
|
||||
float Printl(string in)
|
||||
func Printl(in)
|
||||
{
|
||||
string out = CPP.System.PrintLine(in)
|
||||
return out
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user