Question 1: Setup [4 marks] Create an active Processing function that draws a spaceship on a dark background. The spaceship is a simple triangle shape that can be turned to point in any direction. Use a canvas that is wider than it is high. The screenshots were created with a 600 x 300 canvas Place the ship so that its nose is at the center of the canvas, and so that it is pointing in a randomly chosen direction. The point marked (r, y) on the diagram below is the nose of the ship, and the angle marked of is the direction that the nose is pointing. In the next question, when you make the ship naive, it will always travel in the direction that the nose is pointing. Create global variables for z, y and # (hut give them better nanas in your code). The length & and the angle a describe the shape of the ship. Create global constants for L and a (with better mames), Experiment with values for 2 and a that produce something like the image above. Define a function void dravship () to do the following. . Use the position (F, y), the length L, and the angles & and o to calculate the positions of the other two vertices, and draw the triangle. (Hint: the angles you will need for the other two vertices are 8 + a and 9 - a.) ASSIGNMENT 2 DEPARTMENT AND COURSE NUMBER COMP 1010 . Find the coordinates of the center of the ship by averaging the F coordinates and the coordinates of the three vertices, Draw a dot at the center of the ship to make sure you have found the correct position. Create global variables to hold the r and y coordinates of the ship center: these will be used in later questions. drawlhip () should store the center coordinates that it calculates in these two global variables. Don't proceed to Question 2 until you are sure that the ship will be drawn correctly, no matter what direction it is facing