Пример #1
0
        //--------------------------------------------------------------------------------------
        //Растяжение по оси Y
        public Curve2D GetStretchCurveAlongAxisY(double coefficientOfstretch)
        {
            Point2D[] newPoints = new Point2D[this.PointsCount];
            for (int index = 0; index < this.PointsCount; index++)
            {
                Point2D point    = this.points[index];
                double  newX     = point.X;
                double  newY     = point.Y * coefficientOfstretch;
                Point2D newPoint = new Point2D(newX, newY);
                newPoints[index] = newPoint;
            }
            Curve2D newCurve = new Curve2D(newPoints);

            return(newCurve);
        }
Пример #2
0
        //--------------------------------------------------------------------------------------
        //Смещение кривой
        public Curve2D GetDisplacementCurve(
            double axialDisplacementX,
            double axialdisplacementY
            )
        {
            Point2D[] newPoints = new Point2D[this.PointsCount];
            for (int index = 0; index < this.PointsCount; index++)
            {
                Point2D point    = this.points[index];
                double  newX     = point.X + axialDisplacementX;
                double  newY     = point.Y + axialdisplacementY;
                Point2D newPoint = new Point2D(newX, newY);
                newPoints[index] = newPoint;
            }
            Curve2D newCurve = new Curve2D(newPoints);

            return(newCurve);
        }
Пример #3
0
        //--------------------------------------------------------------------------------------
        //Поворот на угол angle
        public Curve2D GetRotatedCurve(double angle)
        {
            int size = this.PointsCount;

            Point2D[] newArrayPoint = new Point2D[size];
            for (int index = 0; index < size; index++)
            {
                Point2D point = this.points[index];
                double  x     = point.X;
                double  y     = point.Y;
                double  newX  =
                    Math.Cos(angle) * x + Math.Sin(angle) * y;
                double newY =
                    -Math.Sin(angle) * x + Math.Cos(angle) * y;
                Point2D newPoint = new Point2D(newX, newY);
                newArrayPoint[index] = newPoint;
            }
            Curve2D newCurve = new Curve2D(newArrayPoint);

            return(newCurve);
        }