This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* See the whitepaper at https://docs.google.com/file/d/0B9Sf4F-ig8lPUlhOdHZ2ZGtzdnM | |
*/ | |
public static double determinant(double[][] matrix) { | |
return matrix[0][0] * matrix[1][1] * matrix[2][2] + matrix[0][1] * matrix[1][2] * matrix[2][0] + matrix[0][2] * matrix[1][0] * matrix[2][1] - matrix[0][2] * matrix[1][1] * matrix[2][0] - matrix[0][1] * matrix[1][0] * matrix[2][2] - matrix[0][0] * matrix[1][2] * matrix[2][1]; | |
} | |
public static Vector getIntersection(Vector linePoint, Vector lineDirection, Vector planeOrigin, Vector planeXDirection, Vector planeYDirection) { | |
double[][] coefficients = { | |
{lineDirection.getX(), -planeXDirection.getX(), -planeYDirection.getX()}, |