예제 #1
0
        public List <CoorinateFloat> Function2Task(CoorinateFloat centerPoint)
        {
            var goodWith   = Size.Width - OldSize.Width;
            var goodHeight = Size.Height - OldSize.Height;

            var haveA = float.TryParse(task2fromA.Text, out float a);
            var haveB = float.TryParse(task2toB.Text, out float b);
            var haveC = float.TryParse(task2constC.Text, out float c);

            var coordinates = new List <CoorinateFloat>();

            if (!haveA || !haveB || !haveC)
            {
                return(coordinates);
            }

            var dot = new CoorinateFloat(centerPoint);

            for (float i = a; i <= b; i = (float)Math.Round(i + 1f / 100f, 2))
            {
                if (i == 0 || (i + 1) == 0)
                {
                    coordinates.Add(dot.Coordinate(0, 0, true));
                }
                else
                {
                    var y = (c * (i * i) - 1) / (i + 1) + (1 / i) * 20;
                    var x = i * 20;
                    coordinates.Add(dot.Coordinate(x, y));
                }
            }

            return(coordinates);
        }
예제 #2
0
        private List <CoorinateFloat> DrawPoints()
        {
            var centerPoint = new CoorinateFloat((float)Size.Width / 2, (float)Size.Height / 2);


            var coordinates = new List <CoorinateFloat>();

            var point = new CoorinateFloat(centerPoint);

            Brush aBrush = (Brush)Brushes.Black;

            for (var i = 0; i < dataGridView1.Rows.Count; i++)
            {
                var cellX = dataGridView1.Rows[i].Cells[0].Value;
                var cellY = dataGridView1.Rows[i].Cells[1].Value;
                if (cellX != null && cellY != null)
                {
                    var x = int.Parse(dataGridView1.Rows[i].Cells[0].Value.ToString());
                    var y = int.Parse(dataGridView1.Rows[i].Cells[1].Value.ToString());
                    coordinates.Add(point.Coordinate(x, y));
                }
            }
            foreach (var dot in coordinates)
            {
                Options.GraphicsObject.FillRectangle(aBrush, dot.ForDrawX, dot.ForDrawY, 3, 3);
            }
            return(coordinates);
        }
예제 #3
0
        public CustomArrow(CoorinateFloat centerPoint)
        {
            var dot = new CoorinateFloat(centerPoint);

            Coordinates = new List <CoorinateFloat>()
            {
                dot.Coordinate(0, 10),
                dot.Coordinate(220, 10),
                dot.Coordinate(220, 20),
                dot.Coordinate(240, 0),
                dot.Coordinate(220, -20),
                dot.Coordinate(220, -10),
                dot.Coordinate(0, -10),
                dot.Coordinate(0, 10)
            };
        }