Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. private void Quadratic()
  2. {
  3. List<Point> Points = new List<Point>();
  4. for(int i = 0; i < pointX.Length; i++)
  5. {
  6. Points.Add(new Point((int)pointX[i], (int)pointY[i]));
  7. }
  8.  
  9. Point Old;
  10. Point New;
  11. int i = 0;
  12.  
  13. Old = new Point((Points[i].X + Points[i+1].X)/ 2,(Points[i].Y + Points[i + 1].Y)/ 2);
  14.  
  15. for(i = 0; i < Points.Count - 2; i++)
  16. {
  17. for(double j = 0; j < 1.0; j+=0.01)
  18. {
  19. New = new Point(0.5 * (1 - j) * (1 - j) * Points[i].X
  20. + (0.75 - (j - 0.5) * (j - 0.5)) * Points[i + 1].X
  21. + 0.5 * j * j * Points[i + 2].X,
  22. 0.5 * (1 - j) * (1 - j) * Points[i].Y
  23. + (0.75 - (j - 0.5) * (j - 0.5)) * Points[i + 1].Y + 0.5 * j * j * Points[i + 2].Y);
  24. Line((int)Old.X, (int)New.X, (int)Old.Y, (int)New.Y, bitmap, Color.Black);
  25. Old = new Point(New.X, New.Y);
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement