How to realize the fall of canvas picture after rotation

problem description

The effect of the rotation angle falling of the picture in

canvas has been tossing around for a long time, but there are still some anomalies.
the speed is abnormal after rotation, and the normal speed should be the same speed. It is estimated that it has something to do with my (this.x + Math.tan (deg) * this.y) code. This sentence is added in order to fall in a straight line after rotation.
is generated at the wrong height. Normally, it should be generated at the top, but some will generate

at other heights.

these two questions are good after removing the rotation-related code. Please point out

.

key code

    context.save();
    
    context.translate(this.x+($el.widths) / 2, this.y+($el.heights) / 2);
    context.rotate(deg);
    context.translate(-this.x-($el.widths) / 2, -this.y-($el.heights) / 2);
    
    context.drawImage(
        $el.image,
        0, 0,
        $el.widths,
        $el.heights,
        (this.x), this.y,
        $el.widths * this.radio, $el.heights * this.radio
    );
    context.restore();

I still hope to explain the meaning of moving the coordinate system to the center of the picture, rotating and then translating back. Thank you

.
Apr.18,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd8deb-30679.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd8deb-30679.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?