ackvonhuelio Further elaborating upon what you said, it is confusing to know exactly which values to use, and the positive/negative signs that go along. Here is some nice code to do that for you:
function rotateAround(theta, rotateX, rotateY, targetX, targetY){
window.translate(rotateX, rotateY)
window.rotate(theta)
window.translate(-targetX, -targetY)
}