diff --git a/src/Numerics/SpecialFunctions/Evaluate.cs b/src/Numerics/SpecialFunctions/Evaluate.cs
index b170082a..22e06419 100644
--- a/src/Numerics/SpecialFunctions/Evaluate.cs
+++ b/src/Numerics/SpecialFunctions/Evaluate.cs
@@ -4,7 +4,7 @@
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
-// Copyright (c) 2009-2012 Math.NET
+// Copyright (c) 2009-2013 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
@@ -61,6 +61,7 @@ namespace MathNet.Numerics
/// The coefficients of the polynomial.
/// The location where to evaluate the polynomial at.
/// the evaluation of the polynomial.
+ [Obsolete("Use Polynomial(z, params coefficients) instead.")]
public static double Polynomial(double[] coefficients, double z)
{
int count = coefficients.Length;
@@ -74,6 +75,25 @@ namespace MathNet.Numerics
return sum;
}
+ ///
+ /// Evaluate a polynomial at point x.
+ /// Coefficients are ordered by power with power k at index k.
+ /// Example: coefficients [3,-1,2] represent y=2x^2-x+3.
+ ///
+ /// The location where to evaluate the polynomial at.
+ /// The coefficients of the polynomial, coefficient for power k at index k.
+ public static double Polynomial(double z, params double[] coefficients)
+ {
+ double sum = coefficients[coefficients.Length - 1];
+ for (int i = coefficients.Length - 2; i >= 0; --i)
+ {
+ sum *= z;
+ sum += coefficients[i];
+ }
+
+ return sum;
+ }
+
///
/// Numerically stable series summation
///