Exemplo n.º 1
0
        public double getDintancia(Ciudad idOrigen, Ciudad idDestino)
        {
            VueloDao getcord = new VueloDao();

            getcord.getCoordenadas(idOrigen, idDestino);
            double radTierra = 6371;

            double lantO = double.Parse(idOrigen.Latitud) * (Math.PI / 180);  //lant
            double lngO  = double.Parse(idOrigen.Longitud) * (Math.PI / 180); //lng
            double lantD = double.Parse(idDestino.Latitud) * (Math.PI / 180);
            double lngD  = double.Parse(idDestino.Longitud) * (Math.PI / 180);
            double i     =
                (Math.Cos(lantO) * Math.Cos(lantD) * Math.Cos(lngO) * Math.Cos(lngD)
                 + Math.Cos(lantO) * Math.Sin(lngO) * Math.Cos(lantD) * Math.Sin(lngD)
                 + Math.Sin(lantO) * Math.Sin(lantD));
            double j = Math.Acos(i);
            double k = (radTierra * j);

            return(Math.Round(k, 2)); //Distancia en KM
        }
Exemplo n.º 2
0
        public DataSet ciudadOrigen()
        {
            VueloDao getCiudad = new VueloDao();

            return(getCiudad.getCiudadOrigen());
        }
Exemplo n.º 3
0
        public DataSet ciudadDestino(Ciudad ciudad)
        {
            VueloDao getCiudad = new VueloDao();

            return(getCiudad.getCiudadDestino(ciudad));
        }
Exemplo n.º 4
0
        public void insertVuelo(Vuelo vuelo)
        {
            VueloDao vuelodao = new VueloDao();

            vuelodao.ingresarVuelo(vuelo);
        }