using System;
using System.Data.Sql;
using System.Data.SqlTypes;

public class CCoilSpace
{
    [SqlFunction]
    public static double CoilSpace(
		double L, // spring length
		double A, // arbor diatmeter
		double t, // spring thickness
		double theta // extra rotations
		)
    {
		double space = (2.0 * L) /
		(Math.PI * (((Math.Sqrt(A * A + 1.27 * L * t) - A) / 
		(2.0 * t)) - theta));
		return space;
    }
};
