Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Quadratic()
- {
- List<Point> Points = new List<Point>();
- for(int i = 0; i < pointX.Length; i++)
- {
- Points.Add(new Point((int)pointX[i], (int)pointY[i]));
- }
- Point Old;
- Point New;
- int i = 0;
- Old = new Point((Points[i].X + Points[i+1].X)/ 2,(Points[i].Y + Points[i + 1].Y)/ 2);
- for(i = 0; i < Points.Count - 2; i++)
- {
- for(double j = 0; j < 1.0; j+=0.01)
- {
- New = new Point(0.5 * (1 - j) * (1 - j) * Points[i].X
- + (0.75 - (j - 0.5) * (j - 0.5)) * Points[i + 1].X
- + 0.5 * j * j * Points[i + 2].X,
- 0.5 * (1 - j) * (1 - j) * Points[i].Y
- + (0.75 - (j - 0.5) * (j - 0.5)) * Points[i + 1].Y + 0.5 * j * j * Points[i + 2].Y);
- Line((int)Old.X, (int)New.X, (int)Old.Y, (int)New.Y, bitmap, Color.Black);
- Old = new Point(New.X, New.Y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement