(Plot the sine and cosine functions) Write a program that plots the sine function in red and cosine in blue, as shown in Figure 1c.

FIGURE 1 (a) Exercise 14.17 draws a sketch for the hangman game. (c) Exercise 14.18 plots the quadratic function. (c) Exercise 14.19 plots the sine/cosine functions.
Hint: The Unicode for p is \u03c0. To display -2p, use Text(x, y, "-2\u03c0").
For a trigonometric function like sin(x), x is in radians. Use the following loop to add the points to a polyline:
Polyline polyline = new Polyline();
ObservableList
double scaleFactor = 50;
for (int x = -170; x <= 170; x++) {
list.add(x + 200.0);
list.add(100 – 50 * Math.sin((x / 100.0) * 2 * Math.PI));
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.