using System; using System.Collections.Generic; using System.Windows.Forms; using System.Text; namespace TonyFunctions { public class T_Func { public static double caniseeit; #region Conversions /// /// Converts to mm (inch) /// /// /// public static double in_to_mm(double toConvert) { double dblConverted = (toConvert / .03937007); return dblConverted; } /// /// Converts to mm (inch) /// /// /// public static decimal in_to_mm(decimal toConvert) { decimal decConverted = (toConvert / (decimal).03937007); return decConverted; } /// /// Converts to Inches (mm) /// /// /// public static double mm_to_in(double toConvert) { double dblConverted = (toConvert * .03937007); return dblConverted; } /// /// Converts to Inches (mm) /// /// /// public static decimal mm_to_in(decimal toConvert) { decimal decConverted = (toConvert * (decimal).03937007); return decConverted; } #endregion Conversions #region Area and Volume /// /// Calculates Area of circle (Rad in inches) /// /// /// public static double Area_Circle_Rad_in(double dblRad) { double dblArea = (dblRad * 2) * Math.PI; return dblArea; } /// /// Calculates Area of circle (Rad in inches) /// /// /// public static decimal Area_Circle_Rad_in(decimal decRad) { decimal decArea = (decRad * 2) * (decimal)Math.PI; return decArea; } /// /// Calculates Volume of Cyl (Rad in inches,Height) /// /// /// public static double Vol_Cyl_Rad_in(double dblRad, double dblHgt) { double dblVolume = ((dblRad * 2) * Math.PI) * dblHgt; return dblVolume; } /// /// Calculates Volume of Cyl (Rad in inches,Height) /// /// /// public static decimal Vol_Cyl_Rad_in(decimal decRad, decimal decHgt) { decimal decVolume = ((decRad * 2) * (decimal)Math.PI) * decHgt; return decVolume; } ///////// /// /// Calculates Area of circle (Dia in inches) /// /// /// public static double Area_Circle_Dia_in(double dblDia) { double dblArea = dblDia * Math.PI; return dblArea; } /// /// Calculates Area of circle (Dia in inches) /// /// /// public static decimal Area_Circle_Dia_in(decimal decDia) { decimal decArea = decDia * (decimal)Math.PI; return decArea; } /// /// Calculates Volume of Cyl (Dia in inches,Height) /// /// /// public static double Vol_Cyl_Dia_in(double dblDia, double dblHgt) { double dblVolume = (dblDia * Math.PI) * dblHgt; return dblVolume; } /// /// Calculates Volume of Cyl (Dia in inches,Height) /// /// /// public static decimal Vol_Cyl_Dia_in(decimal decDia, decimal decHgt) { decimal decVolume = (decDia * (decimal)Math.PI) * decHgt; return decVolume; } #endregion Area and Volume #region String Stuff /// /// Takes string and returns SPLIT string array (string to split, split char) /// /// /// /// public static string[] saSplit (string strToSplit, char chrSplitter) { string[] saToReturn = strToSplit.Split(new Char[] { chrSplitter });//splits string return saToReturn; } #endregion String Stuff } }