| 467 | |
| 468 | |
| 469 | public void print() { |
| 470 | int big = (int) abs(max(PApplet.max(abs(m00), abs(m01), abs(m02)), |
| 471 | PApplet.max(abs(m10), abs(m11), abs(m12)))); |
| 472 | |
| 473 | int digits = 1; |
| 474 | if (Float.isNaN(big) || Float.isInfinite(big)) { // avoid infinite loop |
| 475 | digits = 5; |
| 476 | } else { |
| 477 | while ((big /= 10) != 0) digits++; // cheap log() |
| 478 | } |
| 479 | |
| 480 | System.out.println(PApplet.nfs(m00, digits, 4) + " " + |
| 481 | PApplet.nfs(m01, digits, 4) + " " + |
| 482 | PApplet.nfs(m02, digits, 4)); |
| 483 | |
| 484 | System.out.println(PApplet.nfs(m10, digits, 4) + " " + |
| 485 | PApplet.nfs(m11, digits, 4) + " " + |
| 486 | PApplet.nfs(m12, digits, 4)); |
| 487 | |
| 488 | System.out.println(); |
| 489 | } |
| 490 | |
| 491 | |
| 492 | ////////////////////////////////////////////////////////////// |