I have a rotation angle:
var dx = this.mouseX - this.startX; var dy = this.mouseY - this.startY; _this.rotation = Math.atan2(dy, dx); And i know my pivot point (center of my image):
var pivotX = this.x + (this.imageWidth / 2); var pivotY = this.y + (this.imageHeight / 2); Now i have got another point:
var rightX = 600; var rightY = 400; How can i rotate this point around my pivot point using the angle that i got from the atan2() function?
rightXandrightYusing the rotation and the pivot point. I dont do more so i cant show more. I found this: stackoverflow.com/questions/2259476/… but they are not working with atan2() and i have no idea about math. I guess i cant copy that.thisand_thisvariables? When are you calling this code? I'm trying to get the whole picture of what you are doing.