How to get the value of X and Y after changing the angle [closed]

I drew this picture to interpret my question.

I have an object that will initially be at X: 0 Y: 0 with an angle of , being 70 wide and 100 high. I need to obtain the new value of the X and Y axis after this same object is rotated to an angle of 45º.

How can I get this value, since the correct value would be X: -25.1 and Y: 39.39

• This is not yet clear. You should edit the pictures in your question to show us just where the point $x=0, y=0$ is in that picture, and just where it has moved to after the rotation. Also tell us what you need to know, since you already seem to know the new values of $x$ and $y$. Commented Sep 27, 2023 at 19:34
• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Sep 27, 2023 at 19:35
• @CrSb0001 I used the Figma software and created a 70x100 object in X:0 Y:0 starting with an angle of 0º, and when changing the angle of this object to 45º I obtained the new values of X: -25.1 and Y: 39.39. The objective is to know what new position the object will occupy after it is rotated, I need this for a programming project. Commented Sep 27, 2023 at 19:48
• @EthanBolker I need to know how to obtain the values of X and Y after rotating an object that can be anywhere in X and Y, I used as an example this 45º rotation that returned . Commented Sep 27, 2023 at 19:52
• Still unclear. The general formulas are here en.wikipedia.org/wiki/Rotation_matrix but you have not described enough so see how they apply in your picture. Commented Sep 27, 2023 at 20:11

Everything you wanted to know about a rotated rectangle of size $$(a,b)$$, and its bounding box.
In the example above the rectangle is rotated by a counter-clockwise angle of $$\theta$$.
\begin{aligned}y & =a\sin\theta\\ x & =b\sin\theta\\ w & =a|\cos\theta|+b|\sin\theta|\\ h & =a|\sin\theta|+b|\cos\theta| \end{aligned}
where $$|\cdot|$$ is the absolute value.
If the angle is negative then use the same equations as above but the definitions of $$(x,y)$$ offsets is a bit different (see below).
Also note that a point $$(a,b)$$ rotated by a CCW angle $$\theta$$ has coordinates $${\rm rot}\left(\pmatrix{a\\b},\theta\right)=\pmatrix{a\cos\theta-b\sin\theta\\a\sin\theta+b\cos\theta}$$