示例#1
0
文件: PolygonData.cs 项目: Arnyev/GK
 public void GetRelations(int index, out VH verticalHorizontal, out int maxSize, out int currentDistance)
 {
     currentDistance =
         _basicCalculator.EuclideanDistance(_points[index], _points[(index + 1) % _currentPointCount]);
     verticalHorizontal = _verticalHorizontals[index];
     maxSize            = _maxSizes[index];
 }
示例#2
0
        private Point ChangeDistance(Point fixedPoint, Point movingPoint, int newDistance)
        {
            var    currentDistance = _basicCalculator.EuclideanDistance(fixedPoint, movingPoint);
            double ratio           = (double)newDistance / currentDistance;

            return(new Point((int)(fixedPoint.X + ratio * (movingPoint.X - fixedPoint.X)),
                             (int)(fixedPoint.Y + ratio * (movingPoint.Y - fixedPoint.Y))));
        }