@@ -0,0 +1,1921 @@
+package org.stuygfx.math;%0A%0Aimport static org.stuygfx.math.MatrixMath.identityMatrix;%0A%0Aimport org.stuygfx.graphics.Edge;%0Aimport org.stuygfx.graphics.EdgeMatrix;%0A%0Apublic class Transformations %7B%0A%0A    public static Matrix getTranslationMatrix(int dx, int dy, int dz) %7B%0A        Matrix transMat = identityMatrix(4);%0A        transMat.data%5B0%5D%5B3%5D = dx;%0A        transMat.data%5B1%5D%5B3%5D = dy;%0A        transMat.data%5B2%5D%5B3%5D = dz;%0A        return transMat;%0A    %7D%0A%0A    public static Matrix getScaleMatrix(double xFac, double yFac, double zFac) %7B%0A        Matrix scaleMat = identityMatrix(4);%0A        scaleMat.data%5B0%5D%5B0%5D = xFac;%0A        scaleMat.data%5B1%5D%5B1%5D = yFac;%0A        scaleMat.data%5B2%5D%5B2%5D = zFac;%0A        return scaleMat;%0A    %7D%0A%0A    public static Matrix getRotXMatrix(double theta) %7B%0A        theta = Math.toRadians(theta);%0A        double%5B%5D%5B%5D data = %7B %7B 1, 0, 0, 0 %7D, %7B 0, Math.cos(theta), -Math.sin(theta), 0 %7D,%0A                %7B 0, Math.sin(theta), Math.cos(theta), 0 %7D, %7B 0, 0, 0, 1 %7D %7D;%0A        return new Matrix(data);%0A    %7D%0A%0A    public static Matrix getRotYMatrix(double theta) %7B%0A        theta = Math.toRadians(theta);%0A        double%5B%5D%5B%5D data = %7B %7B Math.cos(theta), 0, -Math.sin(theta), 0 %7D, %7B 0, 1, 0, 0 %7D,%0A                %7B Math.sin(theta), 0, Math.cos(theta), 0 %7D, %7B 0, 0, 0, 1 %7D %7D;%0A        return new Matrix(data);%0A    %7D%0A%0A    public static Matrix getRotZMatrix(double theta) %7B%0A        theta = Math.toRadians(theta);%0A        double%5B%5D%5B%5D data = %7B %7B Math.cos(theta), -Math.sin(theta), 0, 0 %7D, %7B Math.sin(theta), Math.cos(theta), 0, 0 %7D,%0A                %7B 0, 0, 1, 0 %7D, %7B 0, 0, 0, 1 %7D %7D;%0A        return new Matrix(data);%0A    %7D%0A%0A    public static void applyTransformation(Matrix transMatrix, EdgeMatrix em) %7B%0A        for (Edge e : em.edges) %7B%0A            e.start.fromMatrix(MatrixMath.crossProduct(transMatrix, e.start.toMatrix()));%0A            e.end.fromMatrix(MatrixMath.crossProduct(transMatrix, e.end.toMatrix()));%0A        %7D%0A    %7D%0A%7D%0A

Add transformations