I have a rectangle which is rotated (in this case 45 degrees) and looks like this:
And I know that X is from the top left corner of the rectangle (if it were unrotated, in this case the point at the top of the picture). Y is also from the top left corner. I have the width and the height and the bounding box. I want to find out what the other points of this rectangle are. The top left (technically the X position in this case), the top right, the bottom right and the bottom left. I was trying to use a transformation matrix but I can't seem to wrap my head around it.
How would one find the other points of this rectangle? Technically I am working in JavaScript but any language should be able to deal with this problem.