How to get the left? of an element using css transform Matrix rotation

how to calculate left and top in rotation after getting the matrix?

<div style="width:100px;height:50px;">
</div>
div.style.transform = `rotateZ(45deg)`
// 
let transform = window.getComputedStyle(div)["transform"],
    matrix = transform.slice(7, -1).split(",")
Sep.07,2021

rotation and left , top have nothing to do
if it is div use trigonometric function

left = 100*cos(45/180*Math.PI)
right = 100*sin(45/180*Math.PI)
Menu