Beispiel #1
0
 private latitude(Hemisphere h, int degrees, int minutes, double seconds)
 {
     this.Hemisphere = h;
     this.Degrees    = degrees;
     this.Minutes    = minutes;
     this.Seconds    = seconds;
 }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            QuestionTextValidator validator = new QuestionTextValidator();

            if (!validator.Validate(textBoxQuestion.Text))
            {
                MessageBox.Show("A kérdés szövege nem lehet üres, és nem tartalmazhat speciális karaktert!", "Hiba!", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            string     questionText = textBoxQuestion.Text.Trim();
            Hemisphere hemisphere   = radioLeft.IsChecked.Value ? Hemisphere.Left : Hemisphere.Right;
            bool       isAdult      = radioAdult.IsChecked.Value;

            Question question = new Question
            {
                Text       = questionText,
                IsAdult    = isAdult,
                Hemisphere = hemisphere
            };

            using (QuestionManager questionManager = new QuestionManager())
            {
                questionManager.AddQuestion(question);
            }

            MessageBox.Show("Sikeres mentés!", "Mentés", MessageBoxButton.OK, MessageBoxImage.Information);
        }
Beispiel #3
0
 public Continent(string name, int population, double area, Hemisphere primaryHemisphere)
 {
     Area              = area;
     Name              = name;
     Population        = population;
     PrimaryHemisphere = primaryHemisphere;
 }
Beispiel #4
0
        private static NormalAnimal SelectHemisphereAndConstructInsect(Hemisphere hemisphere, AnimalsInsect obj, bool owned, bool museumHave)
        {
            string time;

            if (obj.Time.Contains("全天"))
            {
                time = "全天";
            }
            else
            {
                time = obj.Time;
            }
            if (hemisphere == Hemisphere.North)
            {
                var normal = new NormalAnimal {
                    Name = obj.Name, Icon = obj.Image, Number = obj.Number, English = obj.English, Japanese = obj.Japanese, Price = Convert.ToInt32(obj.Price), Position = obj.Position, ShapeOrWeather = obj.Weather, Time = time, AppearMonth = MonthStringToList(obj.North), Owned = owned, MuseumHave = museumHave
                };
                return(normal);
            }
            else
            {
                var normal = new NormalAnimal {
                    Name = obj.Name, Icon = obj.Image, Number = obj.Number, English = obj.English, Japanese = obj.Japanese, Price = Convert.ToInt32(obj.Price), Position = obj.Position, ShapeOrWeather = obj.Weather, Time = time, AppearMonth = MonthStringToList(obj.South), Owned = owned, MuseumHave = museumHave
                };
                return(normal);
            }
        }
        /// <summary>
        /// Gets the temperate season in the given <see cref="Hemisphere"/> at the specified <see cref="DateTime"/>.
        /// </summary>
        /// <param name="hemisphere">The hemisphere to use.</param>
        /// <param name="dateTime">The <see cref="DateTime"/> to get the season for.</param>
        /// <returns></returns>
        public static Season GetCurrentTemperateSeason(Hemisphere hemisphere, DateTime dateTime)
        {
            Season season;

            if (DTIsBetween(dateTime, Spring.Start, Spring.End))
            {
                season = Spring;
            }
            else if (DTIsBetween(dateTime, Summer.Start, Summer.End))
            {
                season = Summer;
            }
            else if (DTIsBetween(dateTime, Autumn.Start, Autumn.End))
            {
                season = Autumn;
            }
            else if (DTIsBetween(dateTime, Winter.Start, Winter.End))
            {
                season = Winter;
            }
            else
            {
                throw new Exception("Could not find season for the give DateTime.");
            }

            return(hemisphere == Hemisphere.Northern ? season : GetOppositeHemisphereSeason(season));
        }
 /// <summary>
 /// Gets the <see cref="DateTime"/> representing this <see cref="Season"/>'s starting month and day.
 /// </summary>
 /// <param name="hemisphere">The hemisphere to use.</param>
 /// <returns></returns>
 public DateTime GetStartDate(Hemisphere hemisphere = Hemisphere.Northern)
 {
     return(hemisphere switch
     {
         Hemisphere.Northern => this.Start,
         Hemisphere.Southern => GetOppositeHemisphereSeason(this).Start,
         _ => throw new ArgumentException($"Unknown hemisphere {hemisphere}", nameof(hemisphere)),
     });
Beispiel #7
0
            public override string ToString()
            {
                var percent = Math.Round(Visibility, 2);

                return($"The Moon for {Moment} is {DaysIntoCycle} days\n" +
                       $"into the cycle, and is showing as \"{Name}\"\n" +
                       $"with {percent}% visibility, and a face of {Emoji} from the {Hemisphere.ToString().ToLowerInvariant()} hemisphere.");
            }
Beispiel #8
0
    public UTM(int zone, Hemisphere hemisphere)
    {
        double centralMeridian = zone * 6.0 - 183;
        double falseNorthing   = hemisphere == Hemisphere.North ? 0 : 10000000;
        string proj4Format     = "+proj=tmerc +lon_0={0} +lat_0=0 +k=0.9996 +x_0=500000 +y_0={1} +ellps=GRS80 +datum=NAD83 +to_meter=1 +no_defs";

        Projection = ProjectionInfo.FromProj4String(String.Format(proj4Format, centralMeridian, falseNorthing));
    }
Beispiel #9
0
        public WeatherSample(
            Hemisphere hemisphere,
            byte summerRainfall, byte winterRainfall,
            short summerTemp, short winterTemp,

            //"hottest" and "coldest" are slightly misleading because the values
            //they contain are not necessarily the hottest or coldest of the 4
            //given temperatures. These variables should be understood as "A
            //sample from the [hottest/coldest/summer/winter] global average
            //temperature map"
            short hottestTemp, short coldestTemp)
        {
            Hemisphere = hemisphere;

            //

            var rainfall = new [] { summerRainfall, winterRainfall };

            Array.Sort(rainfall);

            RainfallMin = rainfall[0];
            RainfallMax = rainfall[1];
            RainfallAvg = (byte)Math.Round(
                (summerRainfall + winterRainfall) / 2f);

            if (Hemisphere == Hemisphere.North)
            {
                RainfallSummer = summerRainfall;
                RainfallWinter = winterRainfall;
            }
            else
            {
                RainfallSummer = winterRainfall;
                RainfallWinter = summerRainfall;
            }

            TotalRainfallSummer = RainfallSummer * 6;
            TotalRainfallWinter = RainfallWinter * 6;
            TotalAnnualRainfall = RainfallAvg * 12;

            //

            var temperatures = new[]
            { summerTemp, winterTemp, hottestTemp, coldestTemp };

            Array.Sort(temperatures);

            Temperatures   = temperatures;
            TemperatureMin = temperatures[0];
            TemperatureMax = temperatures[3];
            TemperatureAvg = (short)Math.Round(
                (summerTemp + winterTemp + hottestTemp + coldestTemp) / 4f);

            //

            DesertThreshold = CalculateDesertThreshold();
        }
Beispiel #10
0
        public void ToLatLon(double x, double y, int zone, Hemisphere hemi)
        {
            this.X = x;
            this.Y = y;

            this.Zone = zone;

            UTMXYToLatLon(x, y, hemi != Hemisphere.Northern);
        }
        public void ToLatLon(double x, double y, int zone, Hemisphere hemi)
        {
            this.X = x;
            this.Y = y;

            this.Zone = zone;

            UTMXYToLatLon(x, y, hemi != Hemisphere.Northern);
        }
Beispiel #12
0
 public Georeferencing(double centerEasting, double centerNorthing, int utmZone, Hemisphere hemisphere, float dilutionOfPrecision, int noiseRandomSeed, int maxNoise, SurveyArea surveyArea)
 {
     this.centerEasting       = centerEasting;
     this.centerNorthing      = centerNorthing;
     this.utmZone             = utmZone;
     this.hemisphere          = hemisphere;
     this.dilutionOfPrecision = dilutionOfPrecision;
     Random.InitState(noiseRandomSeed);
     this.noise  = maxNoise;
     this.center = surveyArea.areaToCover.center;
 }
Beispiel #13
0
 /// <summary>
 /// Creates a new <see cref="Dms"/>.
 /// </summary>
 /// <param name="degrees"></param>
 /// <param name="minutes"></param>
 /// <param name="seconds"></param>
 /// <param name="hemisphere">This can be null if <paramref name="degrees"/>, <paramref name="minutes"/>, and <paramref name="seconds"/> all equal zero.</param>
 public Dms(int degrees, int minutes, float seconds, Hemisphere? hemisphere)
 {
     if (!hemisphere.HasValue && (degrees != 0 || minutes != 0 || seconds != 0))
     {
         throw new ArgumentException("The hemisphere value cannot be null unless all of the other parameters are zero.");
     }
     _degrees = degrees;
     _minutes = minutes;
     _seconds = seconds;
     _hemisphere = hemisphere;
 }
Beispiel #14
0
        /// <summary>
        /// Get the significant details of what needs approval
        /// </summary>
        /// <returns>A list of strings</returns>
        public override IDictionary <string, string> SignificantDetails()
        {
            IDictionary <string, string> returnList = base.SignificantDetails();

            returnList.Add("Temperature", TemperatureCoefficient.ToString());
            returnList.Add("Pressure", PressureCoefficient.ToString());
            returnList.Add("Biome", BaseBiome.ToString());
            returnList.Add("Hemisphere", Hemisphere.ToString());

            return(returnList);
        }
    static void Main()
    {
        Hemisphere hemisphere = new Hemisphere();

        Console.Write("How big is the radious of the Hemisphere?\n");
        hemisphere.Radius = Decimal.Parse(Console.ReadLine());

        Console.WriteLine($"\nThe Volume of the Hemisphere is: {hemisphere.Volume}Cm^3");
        Console.WriteLine($"\nThe Curved Surface Area of the Hemisphere is: {hemisphere.CurvedSurfaceArea}Cm^2");
        Console.WriteLine($"\nThe Total Surface Area of the Hemisphere is: {hemisphere.TotalSurfaceArea}Cm^2");

        Console.ReadLine();
    }
Beispiel #16
0
        /// <summary><para>Ein Konstruktor mit den Parametern für Zone, East und Nordwert, sowie Hemisphäre.</para></summary>
        /// <param name="zone">Zone</param>
        /// <param name="east">East</param>
        /// <param name="north">North</param>
        /// <param name="hem">Hemisphäre: Nord, Süd</param>
        protected Geocentric(int zone, double east, double north, Hemisphere hem)
        {
            string band = "N";                                                      // Transformationsroutine auf Nordhalbkugel setzen 
            if (hem == Hemisphere.South) band = "A";                                // Transformationsroutine auf Südhalbkugel setzen 
            Geographic geo = Transform.UTMWGS(new UTM(zone, band, east, north));
            geo.Longitude = Math.Round(geo.Longitude, 4);                           // Ohne Rundung könnte Bandberechnung fehlerbehaftet sein
            geo.Latitude = Math.Round(geo.Latitude, 4);                             // Ohne Rundung könnte Bandberechnung fehlerbehaftet sein
            UTM utm = Transform.WGSUTM(geo);                                       // Doppelte Transformation um Band zu berechnen

            this.East = east;
            this.North = north;
            this.Zone = zone;
            this.Band = utm.Band;

        }
Beispiel #17
0
        /// <summary><para>Ein Konstruktor mit den Parametern für Zone, East und Nordwert, sowie Hemisphäre.</para></summary>
        /// <param name="zone">Zone</param>
        /// <param name="east">East</param>
        /// <param name="north">North</param>
        /// <param name="hem">Hemisphäre: Nord, Süd</param>
        protected Geocentric(int zone, double east, double north, Hemisphere hem)
        {
            string band = "N";                                                      // Transformationsroutine auf Nordhalbkugel setzen 
            if (hem == Hemisphere.South) band = "A";                                // Transformationsroutine auf Südhalbkugel setzen 
            Geographic geo = Transform.UTMWGS(new UTM(zone, band, east, north));
            geo.Longitude = Math.Round(geo.Longitude, 4);                           // Ohne Rundung könnte Bandberechnung fehlerbehaftet sein
            geo.Latitude = Math.Round(geo.Latitude, 4);                             // Ohne Rundung könnte Bandberechnung fehlerbehaftet sein
            UTM utm = Transform.WGSUTM(geo);                                       // Doppelte Transformation um Band zu berechnen

            this.East = east;
            this.North = north;
            this.Zone = zone;
            this.Band = utm.Band;

        }
Beispiel #18
0
        public void ToLatLon(double X, double Y, int zone, Hemisphere Hemi)
        {
            this.X = X;
            this.Y = Y;

            this.Zone = zone;

            if (Hemi == Hemisphere.Northern)
            {
                UTMXYToLatLon(X, Y, false);
            }
            else
            {
                UTMXYToLatLon(X, Y, true);
            }
        }
Beispiel #19
0
        public void ToLatLon(double X, double Y, int zone, Hemisphere Hemi)
        {
            this.X = X;
            this.Y = Y;

            this.Zone = zone;

            if (Hemi == Hemisphere.Northern)
            {
                UTMXYToLatLon(X, Y, false);
            }
            else
            {
                UTMXYToLatLon(X, Y, true);
            }
        }
 private static NormalAnimal SelectHemisphereAndConstructInsect(Hemisphere hemisphere, Insect obj, bool owned, bool museumHave)
 {
     if (hemisphere == Hemisphere.North)
     {
         var normal = new NormalAnimal {
             Name = obj.Name, Icon = $"ms-appx:///Icons/{obj.English}.jpg", Number = obj.Number, English = obj.English, Japanese = obj.Japanese, Price = Convert.ToInt32(obj.Price), Position = obj.Position, ShapeOrWeather = obj.Weather, Time = obj.Time, AppearMonth = obj.Hemisphere.North.Month.AppearMonth, Owned = owned, MuseumHave = museumHave
         };
         return(normal);
     }
     else
     {
         var normal = new NormalAnimal {
             Name = obj.Name, Icon = $"ms-appx:///Icons/{obj.English}.jpg", Number = obj.Number, English = obj.English, Japanese = obj.Japanese, Price = Convert.ToInt32(obj.Price), Position = obj.Position, ShapeOrWeather = obj.Weather, Time = obj.Time, AppearMonth = obj.Hemisphere.South.Month.AppearMonth, Owned = owned, MuseumHave = museumHave
         };
         return(normal);
     }
 }
Beispiel #21
0
        public Season GetSeason(Hemisphere h)
        {
            int diy = DayInYear();

            if (diy >= 80 && diy < 169)
            {
                return(h == Hemisphere.North ? Season.Spring : Season.Autumn);
            }
            if (diy >= 169 && diy < 262)
            {
                return(h == Hemisphere.North ? Season.Summer : Season.Winter);
            }
            if (diy >= 262 && diy < 351)
            {
                return(h == Hemisphere.North ? Season.Autumn : Season.Spring);
            }
            return(h == Hemisphere.North ? Season.Winter : Season.Summer);
        }
        protected DmsCoordinate CalculateDmsCoordinate(Hemisphere hemisphere)
        {
            var value   = Math.Abs(Angle.Value);
            var degrees = Math.Floor(value);
            var minutes = Math.Floor((value - degrees) * 60.0);
            var seconds = ((value - degrees) * 60.0 - minutes) * 60.0;

            CorrectIfSecondsGreaterThan60(ref minutes, ref seconds);
            CorrectIfMinutesGreaterThan60(ref degrees, ref minutes);

            return(new DmsCoordinate()
            {
                Degrees = degrees,
                Minutes = minutes,
                Seconds = seconds,
                Hemisphere = hemisphere
            });
        }
Beispiel #23
0
    void Start()
    {
        VectorLine.SetCamera3D(myCamera);
        demoLine = new VectorLine("demoLine", new List <Vector3>(), 20.0f, LineType.Discrete);
        Hemisphere.CreateHemisphereMesh();
        demoLine.points3.Add(target1.transform.position);
        demoLine.points3.Add(pos.transform.position);
        demoLine.points3.Add(target2.transform.position);
        demoLine.points3.Add(pos.transform.position);
        demoLine.Draw3DAuto();

        origin = GameObject.CreatePrimitive(PrimitiveType.Sphere);
        origin.transform.position = pos.transform.position;
        Destroy(origin.GetComponent <MeshRenderer>());

        freedomPos = GameObject.CreatePrimitive(PrimitiveType.Sphere);
        freedomPos.transform.localScale = new Vector3(0.01F, 0.01F, 0.01F);
        Destroy(freedomPos.GetComponent <MeshRenderer>());
    }
Beispiel #24
0
        /// <summary>
        /// 获取本月的昆虫
        /// </summary>
        /// <param name="bookCount">
        /// </param>
        /// <param name="museumCount">
        /// </param>
        /// <param name="hemisphere">
        /// </param>
        /// <returns>
        /// </returns>
        internal static async Task <List <NormalAnimal> > GetThisMonthInsects(Hemisphere hemisphere)
        {
            //bookCount = 0; museumCount = 0;
            List <NormalAnimal> normalAnimals = new List <NormalAnimal>();
            var animals = await GetAllInsects(hemisphere);

            foreach (var item in animals)
            {
                var thisMonth = DateTime.Now.Month;
                //if (item.Owned) bookCount += 1;
                //if (item.MuseumHave) museumCount += 1;
                if (item.AppearMonth[thisMonth - 1])
                {
                    normalAnimals.Add(item);
                }
            }

            return(normalAnimals);
        }
    // Adds connection to the vertex and generates the truncated hemisphere
    private GameObject truncate(GameObject newHemisphere, GameObject existingTruncation)
    {
        if (newHemisphere == null)
        {
            return(null);
        }
        if (connectionList.Count == 1) //this is the only connection, nothing to do
        {
            truncationExists = true;
            viability        = false;
            return(newHemisphere);
        }
        float scaling = 1;

        if (domain.GetComponent <ResizeObject>().getMagnification() >= 1)
        {
            scaling = 10;
        }
        else
        {
            scaling = 20;
        }
        domain.transform.localScale = domain.transform.localScale * scaling;
        GameObject truncation = Hemisphere.GetIntersection(existingTruncation, newHemisphere, truncatedHemisphereMaterial, true);

        if (truncation == null) //means there was no ove rlapping region
        {
            viability                   = false;
            truncationExists            = false;
            domain.transform.localScale = domain.transform.localScale / scaling;
            return(truncation);
        }
        else
        {
            viability                   = true;
            truncationExists            = true;
            truncation.transform.parent = newHemisphere.transform.parent;
        }

        domain.transform.localScale = domain.transform.localScale / scaling;
        return(truncation);
    }
Beispiel #26
0
        /// <summary>
        /// 获取所有的昆虫
        /// </summary>
        /// <param name="bookCount">
        /// 图鉴开启数量
        /// </param>
        /// <param name="museumCount">
        /// 博物馆收藏数量
        /// </param>
        /// <param name="hemisphere">
        /// 选择南北半球
        /// </param>
        /// <returns>
        /// </returns>
        internal static async Task <List <NormalAnimal> > GetAllInsects(Hemisphere hemisphere)
        {
            //bookCount = 0; museumCount = 0;
            List <NormalAnimal> normalAnimals = new List <NormalAnimal>();
            var con = await SQLiteService.GetDbConnection();

            var animals = await con.Table <AnimalsInsect>().OrderBy(p => p.Number).ToListAsync();

            var usercon = await SQLiteService.GetUserDbConnection();

            foreach (var item in animals)
            {
                //var obj = Newtonsoft.Json.JsonConvert.DeserializeObject<Insect>(item.Data);

                List <UserInsect> userInsect;
                userInsect = await usercon.Table <UserInsect>().Where(p => p.Name == item.Name).ToListAsync();

                if (userInsect.Count > 0)
                {
                    var owned      = userInsect[0].Owned;
                    var museumHave = userInsect[0].MuseumHave;

                    //if (owned) bookCount += 1;
                    //if (museumHave) museumCount += 1;

                    var normal = SelectHemisphereAndConstructInsect(hemisphere, item, owned, museumHave);

                    normalAnimals.Add(normal);
                }
                else
                {
                    var normal = SelectHemisphereAndConstructInsect(hemisphere, item, false, false);

                    normalAnimals.Add(normal);
                }
            }
            await con.CloseAsync();

            await usercon.CloseAsync();

            return(normalAnimals);
        }
Beispiel #27
0
        public static ILatitude parseLatitude(string latitude_string, string hemisphere)
        {
            ILatitude  result  = null;
            int        degrees = crackDegrees(latitude_string);
            int        minutes = crackMinutes(latitude_string);
            double     seconds = crackSeconds(latitude_string);
            Hemisphere H       = Hemisphere.West;

            switch (hemisphere)
            {
            case "N": H = Hemisphere.North; break;

            case "S": H = Hemisphere.South; break;

            case "E": H = Hemisphere.East; break;

            case "W": H = Hemisphere.West; break;
            }
            result = latitude.Create(H, degrees, minutes, seconds);
            return(result);
        }
Beispiel #28
0
    public override void ToGrid(double lon, double lat, out string gridValue)
    {
        char[] letters = new char[3];

        double zoneLat = lat < -80 ? -80 : lat > 72 ? 72 : lat;

        letters[0] = _zoneLetters[Convert.ToInt32(Math.Floor((zoneLat + 80) / 8))];

        double     n          = lon >= 180 ? lon - 180 : lon + 180;
        int        zone       = Convert.ToInt32(Math.Floor(n / 6)) + 1;
        Hemisphere hemisphere = lat >= 0 ? Hemisphere.North : Hemisphere.South;

        UTM utm = new UTM(zone, hemisphere);

        double x;
        double y;

        utm.ToProjected(lon, lat, out x, out y);

        double divisor = Math.Pow(10, 5 - _precision);

        x = Math.Round(x / divisor) * divisor;
        y = Math.Round(y / divisor) * divisor;

        int setNumber = (zone - 1) % 6;

        letters[1] = _columnLetters[(setNumber % 3) * 8 + Convert.ToInt32(Math.Floor(x / 100000)) - 1];

        int rowOffset = setNumber % 2 == 1 ? 5 : 0;

        y         %= 2000000;
        letters[2] = _rowLetters[(Convert.ToInt32(Math.Floor(y / 100000)) + rowOffset) % _rowLetters.Length];

        x = (x % 100000) / divisor;
        y = (y % 100000) / divisor;

        string f = new String('0', _precision);

        gridValue = String.Format("{0}{1} {2} {3}", zone, new String(letters), x.ToString(f), y.ToString(f));
    }
Beispiel #29
0
    public override string ToGrid(Coordinate g)
    {
        char[] letters = new char[3];

        double zoneLat = g.Y < -80 ? -80 : g.Y > 72 ? 72 : g.Y;

        letters[0] = _zoneLetters[Convert.ToInt32(Math.Floor((zoneLat + 80) / 8))];

        double     n          = g.X >= 180 ? g.X - 180 : g.X + 180;
        int        zone       = Convert.ToInt32(Math.Floor(n / 6)) + 1;
        Hemisphere hemisphere = g.Y >= 0 ? Hemisphere.North : Hemisphere.South;

        UTM utm = new UTM(zone, hemisphere);

        Coordinate p = utm.ToProjected(g);
        double     x = p.X;
        double     y = p.Y;

        double divisor = Math.Pow(10, 5 - _precision);

        x = Math.Round(x / divisor) * divisor;
        y = Math.Round(y / divisor) * divisor;

        int setNumber = (zone - 1) % 6;

        letters[1] = _columnLetters[(setNumber % 3) * 8 + Convert.ToInt32(Math.Floor(x / 100000)) - 1];

        int rowOffset = setNumber % 2 == 1 ? 5 : 0;

        y         %= 2000000;
        letters[2] = _rowLetters[(Convert.ToInt32(Math.Floor(y / 100000)) + rowOffset) % _rowLetters.Length];

        x = (x % 100000) / divisor;
        y = (y % 100000) / divisor;

        string f = new String('0', _precision);

        return(String.Format("{0}{1} {2} {3}", zone, new String(letters), x.ToString(f), y.ToString(f)));
    }
    public bool addConnection(GameObject connection, bool drawnTowardConnection)
    {
        /*
         * TODO:
         * Remove freedomLine and plane if a new connection is added when a constraint already exists
         */
        if (connectionList.Contains(connection))
        {
            return(false);
        }
        if (connection.CompareTag("Intermediate"))
        {
            return(false);
        }

        //first, generate a hemisphere
        bool dirTowardConnection = false;

        if (connection.CompareTag("Input") || connection.CompareTag("Output"))
        {
            dirTowardConnection = calculateForceDirection(this.intermediatePoint, connection);
        }
        else
        {
            dirTowardConnection = drawnTowardConnection;
        }

        Vector3    scale      = new Vector3(5, 5, 5);
        GameObject hemisphere = Hemisphere.CreateHemisphere(hemisphereMaterial1, intermediatePoint.transform.position, connection.transform.position, dirTowardConnection, scale);

        connectionList.Add(connection);
        hemisphereList.Add(hemisphere);
        hemisphere.transform.parent     = intermediatePoint.transform;
        hemisphere.transform.localScale = scale;
        truncatedHemisphere             = truncate(hemisphere, truncatedHemisphere);
        return(true);
    }
Beispiel #31
0
        /// <summary>
        /// 获取所有的鱼
        /// </summary>
        /// <param name="bookCount">
        /// 图鉴开启数量
        /// </param>
        /// <param name="museumCount">
        /// 博物馆收藏数量
        /// </param>
        /// <param name="hemisphere">
        /// 选择南北半球
        /// </param>
        /// <returns>
        /// </returns>
        internal static async Task <List <NormalAnimal> > GetAllFishes(Hemisphere hemisphere)
        {
            //bookCount = 0; museumCount = 0;
            List <NormalAnimal> normalAnimals = new List <NormalAnimal>();
            var con = await SQLiteService.GetDbConnection();

            var animals = await con.Table <AnimalsFish>().OrderBy(p => p.Number).ToListAsync();

            var usercon = await SQLiteService.GetUserDbConnection();

            foreach (var item in animals)
            {
                List <UserFish> userFish;
                userFish = await usercon.Table <UserFish>().Where(p => p.Name == item.Name).ToListAsync();

                if (userFish.Count > 0)
                {
                    var owned      = userFish[0].Owned;
                    var museumHave = userFish[0].MuseumHave;
                    //if (owned) bookCount += 1;
                    //if (museumHave) museumCount += 1;

                    var normal = SelectHemisphereAndConstructFish(hemisphere, item, owned, museumHave);
                    normalAnimals.Add(normal);
                }
                else
                {
                    var normal = SelectHemisphereAndConstructFish(hemisphere, item, false, false);
                    normalAnimals.Add(normal);
                }
            }
            await con.CloseAsync();

            await usercon.CloseAsync();

            return(normalAnimals);
        }
Beispiel #32
0
 /// <summary><para>Konstruktor mit Parametern für <see cref="Geocentric.Zone"/>,
 /// <see cref="Geocentric.East"/>, <see cref="Geocentric.North"/> und <see cref="Geocentric.Hemisphere"/>,
 /// ohne <see cref="Geocentric.Band"/>.</para></summary>
 ///
 /// <example>Das folgende Beispiel erzeugt eine Instanz der UTM Klasse und übergibt als Parameter
 /// die Werte für <see cref="Geocentric.Zone"/>, <see cref="Geocentric.East"/>, <see cref="Geocentric.North"/>
 /// und <see cref="Geocentric.Hemisphere"/>. Bitte beachten sie, dass das Band automatisch berechnet wird:
 /// <code>
 /// using GeoUtility.GeoSystem;
 /// UTM utm = new UTM(32, 412345, 5567890, Hemisphere.North);
 /// </code>
 /// </example>
 ///
 /// <param name="zone">Zone</param>
 /// <param name="east">East Wert</param>
 /// <param name="north">North Wert</param>
 /// <param name="hem">Nördliche oder südliche Hemisphäre</param>
 public UTM(int zone, double east, double north, Hemisphere hem) : base(zone, east, north, hem)
 {
 }
Beispiel #33
0
        public void HemisphereTest()
        {
            var hemisphere = new Hemisphere(2);

            Assert.AreEqual(16.75, hemisphere.Volume, 0.01);
        }
Beispiel #34
0
        static void Main(string[] args)
        {
            Console.WriteLine("Area and circumference of circle");
            Console.WriteLine("********************************");

            Circle circle = new Circle();

            Console.Write("Enter the radius of the circle: ");
            string r      = Console.ReadLine();
            double radius = double.Parse(r);

            Console.WriteLine("----------------------------------" + "\n");

            double circumference = circle.Circumference(radius);

            Console.Write("The circumference of the circle is: " + circumference.ToString("F"));
            Console.WriteLine();
            Console.WriteLine("The area of the circle is: " + circle.CircleArea(radius).ToString("F"));
            Console.ReadKey();
            Console.WriteLine("----------------------------------" + "\n");

            Console.WriteLine("Area of triangle");
            Console.WriteLine("****************");

            Triangle triangle = new Triangle();

            Console.Write("Enter the lenght of side A: ");
            string a     = Console.ReadLine();
            int    SideA = int.Parse(a);

            Console.Write("Enter the lenght of side B: ");
            string b     = Console.ReadLine();
            int    SideB = int.Parse(b);

            Console.Write("Enter the lenght of side C: ");
            string c     = Console.ReadLine();
            int    SideC = int.Parse(c);

            Console.WriteLine("----------------------------------" + "\n");

            Console.Write("The area of the triangle is: " + triangle.HeronFormula(SideA, SideB, SideC).ToString("F"));
            Console.WriteLine();
            Console.ReadKey();
            Console.WriteLine("----------------------------------" + "\n");

            Console.WriteLine("Solving a quadratic equation");
            Console.WriteLine("*****************************");

            Quadratic quadratic = new Quadratic();

            Console.Write("Enter A value: ");
            string ax = Console.ReadLine();
            int    A  = int.Parse(ax);

            Console.Write("Enter B value: ");
            string bx = Console.ReadLine();
            int    B  = int.Parse(bx);

            Console.Write("Enter C value: ");
            string cx = Console.ReadLine();
            int    C  = int.Parse(cx);

            Console.WriteLine("----------------------------------" + "\n");

            Console.Write("The result of the equation are: " + quadratic.QuadraticX1(A, B, C).ToString("F") + " and " + quadratic.QuadraticX2(A, B, C).ToString("F"));
            Console.WriteLine();
            Console.ReadKey();
            Console.WriteLine("----------------------------------" + "\n");

            Console.WriteLine("Volume of hemisphere");
            Console.WriteLine("********************");

            Hemisphere hemisphere = new Hemisphere();

            Console.Write("Enter the radius: ");
            string R = Console.ReadLine();
            double HemisphereRaduis = double.Parse(R);

            Console.WriteLine("----------------------------------" + "\n");

            Console.Write("The area of the triangle is: " + hemisphere.HemisphereVolume(HemisphereRaduis).ToString("F"));
            Console.WriteLine();
            Console.ReadKey();
            Console.WriteLine("----------------------------------" + "\n");
        }
Beispiel #35
0
	public UTM(int zone, Hemisphere hemisphere)
	{
		Projection = new TransverseMercator(zone * 6.0 - 183, 0, 0.9996, Spheroid.WGS84);
		FalseNorthing = hemisphere == Hemisphere.North ? 0 : 10000000;
		FalseEasting = 500000;
	}