- Main Page
- Packages
- Classes
- Files

- File List
- File Members

# C:/Documents and Settings/student/My Documents/Visual Studio 2008/projects/UtmConvert/UtmConvert/DegreesToRadians.cs

Go to the documentation of this file.

    00001 ﻿using System;
    00002 using System.Collections.Generic;
    00003 using System.Linq;
    00004 using System.Text;
    00005
    00006 namespace UtmConvert {
    00007     static class DegreesToRadians {
    00008
    00009
    00010         // for dd mm ss format
    00011         public static double getRadians(string degrees
    00012             , string minutes, string seconds, bool plsMns) {
    00013             try {
    00014                 if (plsMns)
    00015                     return -(Math.PI / 180) * (double.Parse(degrees)
    00016                         + double.Parse(minutes) / 60 + double.Parse(seconds) / 3600);
    00017                 return (Math.PI / 180) * (double.Parse(degrees)
    00018                     + double.Parse(minutes) / 60 + double.Parse(seconds) / 3600);
    00019             } catch {
    00020                 return -1;
    00021             }
    00022         }
    00023         //for dd mm format
    00024         public static double getRadians(string degrees
    00025             , string minutes, bool plsMns) {
    00026             try {
    00027                 if(plsMns)
    00028                     return -(Math.PI / 180) * (double.Parse(degrees)
    00029                         + double.Parse(minutes) / 60);
    00030                 return (Math.PI / 180)*(double.Parse(degrees)
    00031                     + double.Parse(minutes) / 60);
    00032             } catch {
    00033                 return -1;
    00034             }
    00035         }
    00036         //for dd format
    00037         public static double getRadians(string degrees, bool plsMns) {
    00038             try {
    00039                 if(plsMns)
    00040                     return -(Math.PI / 180) * (double.Parse(degrees));
    00041                 return (Math.PI / 180)*(double.Parse(degrees));
    00042             } catch {
    00043                 return -1;
    00044             }
    00045         }
    00046
    00047     }
    00048 }