0

So I’m working on a project that is called “Crossed Lines,” and we have to build a program that makes the lines we print appear curved (similar to a grid with a curved slope without the grid being inside the circle). I know that doesn’t make sense but I will attach a reference photo. My teacher isn’t exactly teaching us how to use it well so asking for some help on how to draw it using Graphics Context and loops.

https://i.stack.imgur.com/vZvUL.jpg

camickr
  • 321,443
  • 19
  • 166
  • 288
  • Let's say the rectangle is 200 by 100 pixels. We'll divide each side of the rectangle into 20 increments. That means each horizontal increment is 10 pixels and each vertical increment is 5 pixels. Starting at 0, 0 (upper left corner), draw a line to 200, 5. Next, draw a line from 10, 0 to 200, 10. Next, draw a line from 20, 0 to 200, 15. Repeat until you've drawn 20 lines (the same number of lines as increments. Repeat going from the upper right to the lower horizontal line, going from the lower left to the right vertical, and going from the lower right to the left vertical. – Gilbert Le Blanc Apr 27 '21 at 15:30
  • See: https://stackoverflow.com/questions/16206417/trying-to-draw-lines-with-jpanel/16206641#16206641 – camickr Apr 27 '21 at 17:11
  • Your question does not show that you have made any effort to research the problem, nor have you shown your code. What _specifically_ is your problem? If you just need general assistance then your question is off topic for SO. See [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) for advice on how to improve your question. – skomisa Apr 29 '21 at 20:57

0 Answers0