Sin() static private method

sin x を求める関数。 テイラー展開を利用。 かなり適当に作ってるので、この方法ではそんなに精度はよくない。 とはいえ、10桁程度なら C# 標準の Sin 関数と値が一致するはず。
static private Sin ( double x ) : double
x double
return double
Esempio n. 1
0
        static void Main(string[] args)
        {
            try
            {
                Log.Info("Hello, NLog!");
                Log.Debug("This is a debug message.");
                Log.Warn("This is a warning message.");

                MyMath.Sin(Math.PI);
                MyMath.Sin(Math.PI / 2);
                MyMath.Sin(double.PositiveInfinity);
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Goodbye cruel world.");
            }
        }
Esempio n. 2
0
 /// <summary>Returns the sine of the angle value at index location 0.</summary>
 public virtual double Of(double[] d, int numParam)
 {
     return(MyMath.Sin(d[0]));
 }