// Instructions: // Copy over the matrixMult() and matrixVectorMult() code from // previous exercises. // NOTE: you need to have draw3d.jar in your classpath. import org.edisonwj.draw3d.*; import javafx.application.*; import javafx.scene.*; import javafx.scene.paint.*; import javafx.stage.*; public class MatrixVector3DExample extends Application { String title = "Vector example"; void drawingCommands () { double[][] A = { {3, 2, 1}, {-2, 3, 5}, {0, 0, 3} }; double[][] B = { {-4, 1, 0}, {1, 0, 1}, {3, -2, 1} }; double[] x = {1, -1, 2}; double[] y = matrixVectorMult (A, x); print (y); double[] z = matrixVectorMult (B, y); print (z); double[][] C = matrixMult (B, A); print (C); double[] z2 = matrixVectorMult (C, x); print (z2); d3.setDrawColor (Color.BLUE); d3.drawVector (x); d3.setDrawColor (Color.GREEN); d3.drawVector (y); d3.setDrawColor (Color.RED); d3.drawVector (z); } static double[][] matrixMult (double[][] A, double[][] B) { // INSERT YOUR CODE HERE from MatrixVectorExample2.java } static double[] matrixVectorMult (double[][] A, double[] v) { // INSERT YOUR CODE HERE from MatrixVectorExample.java } static void print (double[] x) { System.out.print ("Vector:"); for (int i=0; i