OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>Geometry Interfaces: DOMMatrixReadOnly skew</title> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 </head> |
| 8 <body> |
| 9 <script> |
| 10 test(function() { |
| 11 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); |
| 12 var skewX = matrix2d.skewX(); |
| 13 assert_true(skewX.is2D); |
| 14 assert_equals(skewX.a, 1); |
| 15 assert_equals(skewX.b, 2); |
| 16 assert_equals(skewX.c, 3); |
| 17 assert_equals(skewX.d, 3.1); |
| 18 assert_equals(skewX.e, 2); |
| 19 assert_equals(skewX.f, 1); |
| 20 }, "DOMMatrixReadOnly skewX() - 2D matrix"); |
| 21 |
| 22 test(function() { |
| 23 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); |
| 24 var skewX = matrix2d.skewX(45); |
| 25 assert_true(skewX.is2D); |
| 26 assert_equals(skewX.a, 1); |
| 27 assert_equals(skewX.b, 2); |
| 28 assert_equals(skewX.c, 4); |
| 29 assert_equals(skewX.d, 5.1); |
| 30 assert_equals(skewX.e, 2); |
| 31 assert_equals(skewX.f, 1); |
| 32 }, "DOMMatrixReadOnly skewX(45) - 2D matrix"); |
| 33 |
| 34 test(function() { |
| 35 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1
2, 13, 14, 15, 16.6]); |
| 36 var skewX = matrix3d.skewX(); |
| 37 assert_false(skewX.is2D); |
| 38 assert_equals(skewX.m11, 1); |
| 39 assert_equals(skewX.m12, 2); |
| 40 assert_equals(skewX.m13, 3); |
| 41 assert_equals(skewX.m14, 4); |
| 42 assert_equals(skewX.m21, 5); |
| 43 assert_equals(skewX.m22, 6); |
| 44 assert_equals(skewX.m23, 7); |
| 45 assert_equals(skewX.m24, 8); |
| 46 assert_equals(skewX.m31, 9); |
| 47 assert_equals(skewX.m32, 10.1); |
| 48 assert_equals(skewX.m33, 11); |
| 49 assert_equals(skewX.m34, 12); |
| 50 assert_equals(skewX.m41, 13); |
| 51 assert_equals(skewX.m42, 14); |
| 52 assert_equals(skewX.m43, 15); |
| 53 assert_equals(skewX.m44, 16.6); |
| 54 }, "DOMMatrixReadOnly skewX() - 3D matrix"); |
| 55 |
| 56 test(function() { |
| 57 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1
2, 13, 14, 15, 16.6]); |
| 58 var skewX = matrix3d.skewX(45); |
| 59 assert_false(skewX.is2D); |
| 60 assert_equals(skewX.m11, 1); |
| 61 assert_equals(skewX.m12, 2); |
| 62 assert_equals(skewX.m13, 3); |
| 63 assert_equals(skewX.m14, 4); |
| 64 assert_equals(skewX.m21, 6); |
| 65 assert_equals(skewX.m22, 8); |
| 66 assert_equals(skewX.m23, 10); |
| 67 assert_equals(skewX.m24, 12); |
| 68 assert_equals(skewX.m31, 9); |
| 69 assert_equals(skewX.m32, 10.1); |
| 70 assert_equals(skewX.m33, 11); |
| 71 assert_equals(skewX.m34, 12); |
| 72 assert_equals(skewX.m41, 13); |
| 73 assert_equals(skewX.m42, 14); |
| 74 assert_equals(skewX.m43, 15); |
| 75 assert_equals(skewX.m44, 16.6); |
| 76 }, "DOMMatrixReadOnly skewX(45) - 3D matrix"); |
| 77 |
| 78 test(function() { |
| 79 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); |
| 80 var skewY = matrix2d.skewY(); |
| 81 assert_true(skewY.is2D); |
| 82 assert_equals(skewY.a, 1); |
| 83 assert_equals(skewY.b, 2); |
| 84 assert_equals(skewY.c, 3); |
| 85 assert_equals(skewY.d, 3.1); |
| 86 assert_equals(skewY.e, 2); |
| 87 assert_equals(skewY.f, 1); |
| 88 }, "DOMMatrixReadOnly skewY() - 2D matrix"); |
| 89 |
| 90 test(function() { |
| 91 var matrix2d = new DOMMatrixReadOnly([2, 2, 2, 2, 2, 2]); |
| 92 var skewY = matrix2d.skewY(45); |
| 93 assert_true(skewY.is2D); |
| 94 assert_equals(skewY.a, 4); |
| 95 assert_equals(skewY.b, 4); |
| 96 assert_equals(skewY.c, 2); |
| 97 assert_equals(skewY.d, 2); |
| 98 assert_equals(skewY.e, 2); |
| 99 assert_equals(skewY.f, 2); |
| 100 }, "DOMMatrixReadOnly skewY(45) - 2D matrix"); |
| 101 |
| 102 test(function() { |
| 103 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1
2, 13, 14, 15, 16.6]); |
| 104 var skewY = matrix3d.skewY(); |
| 105 assert_false(skewY.is2D); |
| 106 assert_equals(skewY.m11, 1); |
| 107 assert_equals(skewY.m12, 2); |
| 108 assert_equals(skewY.m13, 3); |
| 109 assert_equals(skewY.m14, 4); |
| 110 assert_equals(skewY.m21, 5); |
| 111 assert_equals(skewY.m22, 6); |
| 112 assert_equals(skewY.m23, 7); |
| 113 assert_equals(skewY.m24, 8); |
| 114 assert_equals(skewY.m31, 9); |
| 115 assert_equals(skewY.m32, 10.1); |
| 116 assert_equals(skewY.m33, 11); |
| 117 assert_equals(skewY.m34, 12); |
| 118 assert_equals(skewY.m41, 13); |
| 119 assert_equals(skewY.m42, 14); |
| 120 assert_equals(skewY.m43, 15); |
| 121 assert_equals(skewY.m44, 16.6); |
| 122 }, "DOMMatrixReadOnly skewY() - 3D matrix"); |
| 123 |
| 124 test(function() { |
| 125 var matrix3d = new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1]); |
| 126 var skewY = matrix3d.skewY(45); |
| 127 assert_false(skewY.is2D); |
| 128 assert_equals(skewY.m11, 2); |
| 129 assert_equals(skewY.m12, 2); |
| 130 assert_equals(skewY.m13, 2); |
| 131 assert_equals(skewY.m14, 2); |
| 132 assert_equals(skewY.m21, 1); |
| 133 assert_equals(skewY.m22, 1); |
| 134 assert_equals(skewY.m23, 1); |
| 135 assert_equals(skewY.m24, 1); |
| 136 assert_equals(skewY.m31, 1); |
| 137 assert_equals(skewY.m32, 1); |
| 138 assert_equals(skewY.m33, 1); |
| 139 assert_equals(skewY.m34, 1); |
| 140 assert_equals(skewY.m41, 1); |
| 141 assert_equals(skewY.m42, 1); |
| 142 assert_equals(skewY.m43, 1); |
| 143 assert_equals(skewY.m44, 1); |
| 144 }, "DOMMatrixReadOnly skewY(45) - 3D matrix"); |
| 145 </script> |
| 146 </body> |
| 147 </html> |
OLD | NEW |