blob: 5006769fa400b65d8263e25bf55f1aca1c8ec1fa [file] [log] [blame]
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: 2d.transformation.rotate3d.Y</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
<body class="show_output">
<h1>2d.transformation.rotate3d.Y</h1>
<p class="desc">rotate3d() around the y axis results in the correct transformation matrix</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
var t = async_test("rotate3d() around the y axis results in the correct transformation matrix");
_addTest(function(canvas, ctx) {
// angles are in radians, test something that is not a multiple of pi
const angle = 2;
const domMatrix = new DOMMatrix();
ctx.rotate3d(0, angle, 0);
domMatrix.rotateAxisAngleSelf(0, 1, 0, rad2deg(angle));
_assertMatricesApproxEqual(domMatrix, ctx.getTransform())
ctx.rotate3d(0, angle, 0);
domMatrix.rotateAxisAngleSelf(0, 1, 0, rad2deg(angle));
_assertMatricesApproxEqual(domMatrix, ctx.getTransform())
});
</script>