
Write a
Hints: The above scene is 800 pixels wide and 600 pixels tall. On the x-axis, -2π is at pixel (200, 300),
the center of the axis is at (400, 300), and 2π is at (600, 300). Draw your text for these points near (but
not directly on) these coordinates. The Unicode for π is \u03c0. To display -2π, use Text(x, y, “-
2\u03c0”). My program used Font.font("Georgia", 25) as the font for each of the Text objects. (Recall
that you use the setFont(…) on a Text object to set its font.
For a trigonometric function like Math.sin(x), x is in radians. You can use the following loop to add the points to a polyline for the sine curve: Polyline sineCurve = new Polyline();
ObservableList list = sineCurve.getPoints();
for (double x = -340; x <= 340; x++) {
list.add(x + 400);
list.add(300 – 100 * Math.sin((x / 200.0) * 2 * Math.PI));
Your program can draw the entire sine curve as a single polyline. Remember to set its color to red.
The cosecant is a little trickier. Recall from your pre-calculus course that the cosecant (csc) function is
defined by csc(x) = 1 / sin(x). Because the cosecant curve approaches positive and negative infinity,
alternately, on each side of each vertical asymptote, it will not work to draw the cosecant curve as a single
polyline. Your program will need to draw eight different polylines to represent the cosecant. Several
approaches to this part of the assignment will work. My approach is to have the program check when the
sign of the y-coordinate of the cosecant curve changes. When it changes, my program adds to the scene
the current polyline and then creates a new, empty polyline for the next part of the curve. Use whatever
approach you think is reasonable, as long as your code is reasonably clear and concise. Remember to set
the color to blue.

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- Can you please please help me with this problem and the parts. Can you please show photos or drawing something that will help me visually to help me understand it better. i only need help is with part B and can you label part B and can you explain it step by step with something visualarrow_forwardusing python language Using the piece of code on the previous slide, modify the code removing the x += 1 portion and run the code. What happens? Now modify the code to print the numbers but in reverse order Lastly, modify the code to print the numbers 1 through 10 which are not divisible by 3arrow_forwardUse python code with "def drawItem(img,item,row,col):" but without using cv2,PIL or numpy drawItem(canvas, item, row, col) - Modify canvas by drawing the non-white pixels of the item (intended to be the image of a word) onto canvas. Row and col represent the top left pixel of canvas where the item (the item's top left 0,0 pixel) should be placed. Canvas and item are 2D images of RGB pixels. This function should assume that the canvas image is large enough to contain the item img in the row col indicated; row and col do NOT need to be validated.arrow_forward
- Write a program that makes a shape of numbers same as the one below, for a number 'x' that is entered by the user ? 1 22 333 4444 55555 XXXXXXXXXarrow_forwardProgram should be in Python.Write a program with user defined function to plot and show 3points and a line passing through these points in 3D. Declare thesepoints p1,p2 and p3 as your input arguments. Show these points as circle or diamond symbol in a color of your choice. Attach the plotfigure along with the code snippet.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





