MCPcopy Index your code
hub / github.com/processing/processing / invert

Method invert

core/src/processing/core/PMatrix2D.java:434–455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432 * Implementation stolen from OpenJDK.
433 */
434 public boolean invert() {
435 float determinant = determinant();
436 if (Math.abs(determinant) <= Float.MIN_VALUE) {
437 return false;
438 }
439
440 float t00 = m00;
441 float t01 = m01;
442 float t02 = m02;
443 float t10 = m10;
444 float t11 = m11;
445 float t12 = m12;
446
447 m00 = t11 / determinant;
448 m10 = -t10 / determinant;
449 m01 = -t01 / determinant;
450 m11 = t00 / determinant;
451 m02 = (t01 * t12 - t11 * t02) / determinant;
452 m12 = (t10 * t02 - t00 * t12) / determinant;
453
454 return true;
455 }
456
457
458 /**

Callers

nothing calls this directly

Calls 2

determinantMethod · 0.95
absMethod · 0.45

Tested by

no test coverage detected