" & vbCrLf Response.Write "

No value was entered for latitude

" & vbCrLf Response.Write "" Response.End End If ' If decimal longitude was entered, convert it to degrees, minutes, and ' seconds. If longitude was entered in degrees, minutes, and seconds, ' convert to decimal degrees. If lon <> "" Then If lon < 0 Then lon = 0 - lon dLon = Int(lon) mLon = 60 * (lon - dLon) sLon = 60 * (mLon - int(mLon)) mLon = int(mLon) lon = 0 - lon dLon = 0 - dLon ElseIf dLon <> "" Then If dLon > 0 Then dLon = 0 - dLon If mLon = "" Then mLon = 0 If sLon = "" Then sLon = 0 lon = dLon - (mLon / 60) - (sLon / 3600) Else Response.Write "No longitude entered" & vbCrLf Response.Write "

No value was entered for longitude

" & vbCrLf Response.Write "" Response.End End If 'Round the seconds of latitude and longitude sLat = (CLng(sLat * 100)) / 100 sLon = (CLng(sLon * 100)) / 100 ' Set up the coordinate system parameters. 'a = 6378206.4 ' major radius of ellipsoid, map units (NAD 27) 'e = 0.08227185422 ' eccentricity of ellipsoid (NAD 27) a = 6378137 ' major radius of ellipsoid, map units (NAD 83) e = 0.08181922146 ' eccentricity of ellipsoid (NAD 83) angRad = 0.01745329252 ' number of radians in a degree pi4 = 3.141592653582 / 4 ' Pi / 4 p0 = 44.25 * angRad ' latitude of origin p1 = 45 * angRad ' latitude of first standard parallel p2 = 49 * angRad ' latitude of second standard parallel m0 = -109.5 * angRad ' central meridian X0 = 600000 ' False easting of central meridian, map units ' Calculate the coordinate system constants. m1 = Cos(p1) / Sqr(1 - ((e ^ 2) * Sin(p1) ^ 2)) m2 = Cos(p2) / Sqr(1 - ((e ^ 2) * Sin(p2) ^ 2)) t0 = Tan(pi4 - (p0 / 2)) t1 = Tan(pi4 - (p1 / 2)) t2 = Tan(pi4 - (p2 / 2)) t0 = t0 / (((1 - (e * (Sin(p0)))) / (1 + (e * (Sin(p0))))) ^ (e / 2)) t1 = t1 / (((1 - (e * (Sin(p1)))) / (1 + (e * (Sin(p1))))) ^ (e / 2)) t2 = t2 / (((1 - (e * (Sin(p2)))) / (1 + (e * (Sin(p2))))) ^ (e / 2)) n = Log(m1 / m2) / Log(t1 / t2) f = m1 / (n * (t1 ^ n)) rho0 = a * f * (t0 ^ n) ' Convert the latitude/longitude to a coordinate. lat = lat * angRad lon = lon * angRad t = Tan(pi4 - (lat / 2)) t = t / (((1 - (e * (sin(lat)))) / (1 + (e * (sin(lat))))) ^ (e / 2)) rho = a * f * (t ^ n) theta = n * (lon - m0) x = (rho * sin(theta)) + X0 y = rho0 - (rho * cos(theta)) lat = lat / angRad lon = lon / angRad 'Round the coordinates x = (CLng(x * 100)) / 100 y = (CLng(y * 100)) / 100 lat = (CLng(lat * 100000)) / 100000 lon = (CLng(lon * 100000)) / 100000 %> Latitude/Longitude Converted to State Plane

Latitude/Longitude Converted to State Plane

Latitude: Longitude:
Decimal Degrees: <%=lat%> <%=lon%>
Degrees, Minutes, Seconds: <%=dLat%>   <%=mLat%>   <%=sLat%>   <%=dLon%>   <%=mLon%>   <%=sLon%>  
State Plane Coordinate
Northing Easting
Meters <%=y%> <%=x%>