当前位置: 首页>>代码示例>>C#>>正文


C# System.Point类代码示例

本文整理汇总了C#中System.Point的典型用法代码示例。如果您正苦于以下问题:C# Point类的具体用法?C# Point怎么用?C# Point使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Point类属于System命名空间,在下文中一共展示了Point类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddMap

 public void AddMap(RobotMap map, Point offset)
 {
     foreach (var item in map.Map)
     {
         Map.Add(item.Key + offset, item.Value);
     }
 }
开发者ID:exyi,项目名称:LtpRobot,代码行数:7,代码来源:RobotMap.cs

示例2: GetFeature

            /// <summary>
            /// Blocking unary call example.  Calls GetFeature and prints the response.
            /// </summary>
            public void GetFeature(int lat, int lon)
            {
                try
                {
                    Log("*** GetFeature: lat={0} lon={1}", lat, lon);

                    Point request = new Point { Latitude = lat, Longitude = lon };
                    
                    Feature feature = client.GetFeature(request);
                    if (feature.Exists())
                    {
                        Log("Found feature called \"{0}\" at {1}, {2}",
                            feature.Name, feature.Location.GetLatitude(), feature.Location.GetLongitude());
                    }
                    else
                    {
                        Log("Found no feature at {0}, {1}",
                            feature.Location.GetLatitude(), feature.Location.GetLongitude());
                    }
                }
                catch (RpcException e)
                {
                    Log("RPC failed " + e);
                    throw;
                }
            }
开发者ID:rwightman,项目名称:grpc,代码行数:29,代码来源:Program.cs

示例3: GetInsidePoint

 public static Point GetInsidePoint(IReadOnlyList<Point> points, Box boundingBox)
 {
     var y = (boundingBox.MinY + boundingBox.MaxY) / 2;
     var xIntersections = new List<double>();
     var point1 = points.Last();
     foreach (var point2 in points)
     {
         if ((y > point1.Y) != (y > point2.Y))
         {
             xIntersections.Add((y - point2.Y) * (point1.X - point2.X) / (point1.Y - point2.Y) + point2.X);
         }
         point1 = point2;
     }
     xIntersections.Sort();
     Debugger.BreakWhen(xIntersections.Count == 0 || xIntersections.Count % 2 != 0);
     var x = (boundingBox.MinX + boundingBox.MaxX) / 2;
     var maxDelta = double.NegativeInfinity;
     for (var i = 0; i < xIntersections.Count - 1; i += 2)
     {
         var delta = Math.Abs(xIntersections[i] - xIntersections[i + 1]);
         if (delta > maxDelta)
         {
             x = (xIntersections[i] + xIntersections[i + 1]) / 2;
             maxDelta = delta;
         }
     }
     var point = new Point(x, y);
     #if DEBUG
     Debugger.BreakWhen(!PointInPolygonTest.Contains(points, point));
     #endif
     return point;
 }
开发者ID:rflechner,项目名称:SvgToVectorDrawableConverter,代码行数:32,代码来源:PointInsidePolygonCalculator.cs

示例4: RectangleImpl

 public RectangleImpl(Point lowerLeft, Point upperRight)
 {
     this.minX = lowerLeft.GetX();
     this.maxX = upperRight.GetX();
     this.minY = lowerLeft.GetY();
     this.maxY = upperRight.GetY();
 }
开发者ID:ccurrens,项目名称:Spatial4n,代码行数:7,代码来源:RectangleImpl.cs

示例5: TimKiemNuocDi

        // p1: đối thủ
        // p2: 
        private Point TimKiemNuocDi(int p1, int p2)
        {
            Point oCoResult = new Point();
            long DiemMax = 0;
            for (int i = 0; i < cell_quantity; i++)
            {
                for (int j = 0; j < cell_quantity; j++)
                {
                    if (matrix[i, j] == 0)
                    {
                        long DiemTanCong = DiemTanCong_DuyetDoc(i, j, p1, p2) + DiemTanCong_DuyetNgang(i, j, p1, p2) + DiemTanCong_DuyetCheoNguoc(i, j, p1, p2) + DiemTanCong_DuyetCheoXuoi(i, j, p1, p2);
                        long DiemPhongNgu = DiemPhongNgu_DuyetDoc(i, j, p1, p2) + DiemPhongNgu_DuyetNgang(i, j, p1, p2) + DiemPhongNgu_DuyetCheoNguoc(i, j, p1, p2) + DiemPhongNgu_DuyetCheoXuoi(i, j, p1, p2);
                        long DiemTam = DiemTanCong > DiemPhongNgu ? DiemTanCong : DiemPhongNgu;
                        if (DiemMax < DiemTam)
                        {
                            DiemMax = DiemTam;
                            oCoResult = new Point(i, j);

                        }
                    }
                }
            }

            return oCoResult;
        }
开发者ID:haandang,项目名称:1312179_Gomoku,代码行数:27,代码来源:TimKiemNuocDi.cs

示例6: TestDistance

 public void TestDistance()
 {
     Point p1 = new Point(-2, -3);
     Point p2 = new Point(-4, 4);
     double distance = Trigonometry.Distance(p1, p2);
     Assert.AreEqual(7.28, distance, 0.01);
 }
开发者ID:ZoolWay,项目名称:Geometry,代码行数:7,代码来源:TrigonometryTest.cs

示例7: Func1

 public void Func1()
 {
     Point a = new Point(10, 10);
     Point b = a;
     a.x = 100;
     System.Console.WriteLine(b.x);
 }
开发者ID:Puppetplay,项目名称:Effective,代码行数:7,代码来源:_1_Structure.cs

示例8: Filter

        public IList<Point> Filter(IList<Point> points)
        {
            IList<Point> result = new List<Point>();
            if (points.Count == 0)
            {
                return result;
            }

            var point = new Point(points.First());
            result.Add(point);

            foreach (var currentSourcePoint in points.Skip(1))
            {
                if (!this.DistanceIsTooSmall(currentSourcePoint, point))
                {
                    point = new Point(currentSourcePoint);
                    result.Add(point);
                }
            }

            if (this.checkBoundary && result.Count > 1)
            {
                CheckFirstAndLastPoint(result);
            }

            return result;
        }
开发者ID:an83,项目名称:KinectTouch2,代码行数:27,代码来源:LineThinner.cs

示例9: PrintGrid

        public static string PrintGrid(int[,] grid, IEnumerable<Point> path = null, IEnumerable<Point> pawns = null)
        {
            string str = string.Empty;
            HashSet<Point> pathPoints = new HashSet<Point>(path);

            for (int j = 0; j < grid.GetLength(0); j++) {
                for (int i = 0; i < grid.GetLength(1); i++) {
                    Point point = new Point(i, j);
                    if (pawns != null && pawns.Contains(point)) {
                        str += "╬";
                    } else if (path != null && pathPoints.Contains(point)) {
                        str += "┼";
                    } else {
                        switch (grid[j, i]) {
                            case Board.WALL_TILE:
                                str += "█";
                                break;
                            case Board.FLOOR_TILE:
                                str += "░";
                                break;
                        }
                    }
                }
                str += "\n";
            }

            return str;
        }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:28,代码来源:BoardCommon.cs

示例10: Vertex

 public Vertex(Point p)
 {
     Self = p;
     Num = Low = 0;
     Visited = false;
     Parent = null;
 }
开发者ID:analyst74,项目名称:aichallenge-tron,代码行数:7,代码来源:Vertex.cs

示例11: Pathfinding

 public Pathfinding(Map ma, Point m, Point t, int r)
 {
     map = ma;
     me = m;
     target = t;
     range = r;
 }
开发者ID:bytecode0101,项目名称:uWarcraft,代码行数:7,代码来源:Pathfinding.cs

示例12: ToPixelSpace

 public Point ToPixelSpace(Point quadraticPos)
 {
     var pixelPos = new Point(
         quadraticToPixelScale.Width * quadraticPos.X + quadraticToPixelOffset.X,
         quadraticToPixelScale.Height * quadraticPos.Y + quadraticToPixelOffset.Y);
     return new Point((float)Math.Round(pixelPos.X, 2), (float)Math.Round(pixelPos.Y, 2));
 }
开发者ID:lilinghui,项目名称:DeltaEngine,代码行数:7,代码来源:ScreenSpace.cs

示例13: SubmitForm

 public override void SubmitForm(Form form)
 {
     base.SubmitForm(form);
     BlockWidth = (int)form.Datas["BlockWidth"];
     BlockHeight = (int)form.Datas["BlockHeight"];
     BlockCenter = (Point)form.Datas["BlockCenter"];
 }
开发者ID:BlaisePascalSi,项目名称:PokeSi,代码行数:7,代码来源:MultiTileTile.cs

示例14: PrintMap

 public string[] PrintMap(int xMin, int yMin, int width, int heigth, Point robotPosition)
 {
     var robotX = robotPosition.X - xMin;
     var robotY = robotPosition.Y - yMin;
     var result = new string[heigth];
     for (int y = 0; y < heigth; y++)
     {
         var ch = new char[width];
         for (int x = 0; x < width; x++)
         {
             var p = new Point(xMin + x, yMin + y);
             if(robotX == x && robotY == y)
             {
                 ch[x] = '&';
             }
             else if (Map.ContainsKey(p))
             {
                 ch[x] = (char)Map[p];
             }
             else ch[x] = ' ';
         }
         result[y] = new string(ch);
     }
     Array.Reverse(result);
     return result;
 }
开发者ID:exyi,项目名称:LtpRobot,代码行数:26,代码来源:RobotMap.cs

示例15: GetPointAtFractionLength

        public Point GetPointAtFractionLength(double t, out Point tangent)
        {
            // Calculate point on curve.
            double x = (1 - t) * (1 - t) * (1 - t) * Point0.X +
                       3 * t * (1 - t) * (1 - t) * Point1.X +
                       3 * t * t * (1 - t) * Point2.X +
                       t * t * t * Point3.X;

            double y = (1 - t) * (1 - t) * (1 - t) * Point0.Y +
                       3 * t * (1 - t) * (1 - t) * Point1.Y +
                       3 * t * t * (1 - t) * Point2.Y +
                       t * t * t * Point3.Y;

            Point point = new Point(x, y);

            // Calculate tangent to curve.
            x = 3 * (1 - t) * (1 - t) * (Point1.X - Point0.X) +
                6 * t * (1 - t) * (Point2.X - Point1.X) +
                3 * t * t * (Point3.X - Point2.X);

            y = 3 * (1 - t) * (1 - t) * (Point1.Y - Point0.Y) +
                6 * t * (1 - t) * (Point2.Y - Point1.Y) +
                3 * t * t * (Point3.Y - Point2.Y);

            tangent = new Point(x, y);
            return point;
        }
开发者ID:jenart,项目名称:xamarin-forms-book-preview-2,代码行数:27,代码来源:BezierSpline.cs


注:本文中的System.Point类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。