Write programs in JavaScript to accomplish the following:

1. [20 points] Using the line function, create a triangle with vertices at (100, 200), (200, 200), and (150, 100) Write the x, y coordinates of the uppermost vertex next to that point using the text function.

2. [20 points] Create a function that will allow you to draw the triangle you developed in problem one at any place on the screen by passing your function parameters for the upper most x and y coordinates.

3. [20 points] Using the draw function make your triangle move across the canvas, entering on the left side and exiting on the right side.

4. [40 points] Using the draw function make two triangles converge at the center. The triangles should enter the screen from opposite sides, and progress toward each other at equal rates and meet in the center. Fill the triangle that approaches from the right with orange, and the triangle approaching from the left with blue. Change the color of the converged (combined) triangles with red. Set the background color to a pale yellow. Note: make the “step size” a variable. For this problem you are allowed to use the built-in triangle function, it will make it possible to fill the triangle with color. Please do this in the javascript program on khan academy and copy the code on microsoft word. Thanks.

Looking for solution of this Assignment?

WHY CHOOSE US?

We deliver quality original papers

Our experts write quality original papers using academic databases.We dont use AI in our work. We refund your money if AI is detected  

Free revisions

We offer our clients multiple free revisions just to ensure you get what you want.

Discounted prices

All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount

100% originality

We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity.We have ZERO TOLERANCE TO USE OF AI

On-time delivery

We will deliver your paper on time even on short notice or  short deadline, overnight essay or even an urgent essay