コード例 #1
0
        private void CalculateArea()
        {
            AreaGood = true;
            area     = 0;
            for (int i = 0; i < corners.Length; i++)
            {
                Vector2 corner1 = corners[i];
                Vector2 corner2 = corners[(i + 1) % corners.Length];
                Vector2 center  = Vector2.Zero;

                area += (1 / 2f) * LocationManager.getDistance(center, corner1) * LocationManager.getDistance(center, corner2) * (float)Math.Sin(LocationManager.NormalRelitiveAngle_NormalInput(LocationManager.getRotation(center, corner1), LocationManager.getRotation(center, corner2)));
            }
        }