Drawing the graph of sin(x) in java
问题 I am currently trying to draw the graph of sin(x) in java. I am required by the instructions of my assignment to only use drawLine() as the method of drawing the graph. I can't seem to figure out how to properly set my y value though. Right now what I have is a while loop used in order to draw the line pixel by pixel, but cannot manage to get the y value to be correct. Here is what I have so far. public class GraphJComponent extends JComponent { public void paintComponent (Graphics g){ Color