private double[] MultiplicarPontos(double[][] mat, Pontos p) { int i, j; double[] vet = { p.getX(), p.getY(), p.getZ(), 1 }; double[] resul = new double[4]; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { resul[i] += vet[j] * mat[j][i]; } } for (i = 0; i < 4; i++) { resul[i] = Math.Round(resul[i]); } return(resul); }
public Vetor(Pontos ab, Pontos ac) { this.x = (ab.getY() * ac.getZ()) - (ac.getY() * ab.getZ()); this.y = (ab.getZ() * ac.getX()) - (ac.getZ() * ab.getX()); this.z = (ab.getX() * ac.getY()) - (ab.getY() * ac.getX()); }