Imports System
Imports System.Reflection
Imports System.Runtime.CompilerServices

'To sign this assembly, compile it from the command-line with vbc
' and uncomment the following line
'<Assembly: AssemblyKeyFile("pubpriv.snk")>  

Namespace MetricFunctions

    Public Class MetricConverter

        Private Const KilometersPerMile As Double = 1.609347
        Private Const KilogramsPerPound As Double = 0.4535924

        Public Shared Function FahrenheitToCentigrade(ByVal v As Double) As Double
            Return ((v - 32) / 9) * 5
        End Function

        Public Shared Function CentigradeToFahrenheit(ByVal v As Double) As Double
            Return (v * 9) / 5 + 32
        End Function

        Public Shared Function MilesToKilometers(ByVal v As Double) As Double
            Return v * KilometersPerMile
        End Function

        Public Shared Function KilometersToMiles(ByVal v As Double) As Double
            Return v / KilometersPerMile
        End Function

        Public Shared Function PoundsToKilograms(ByVal v As Double) As Double
            Return v * KilogramsPerPound
        End Function

        Public Shared Function KilogramsToPounds(ByVal v As Double) As Double
            Return v / KilogramsPerPound
        End Function

    End Class

End Namespace