How to calculate X2 Y2 (Offset from left top corner) From given example. I have red values from Image and i want calculate grey values
(Computing in JS)
This post might point you in the right direction, to at least get the X2 Y2: https://gamedev.stackexchange.com/questions/86755/how-to-calculate-corner-positions-marks-of-a-rotated-tilted-rectangle
The formula they have is:
X = x*cos(θ) - y*sin(θ)
Y = x*sin(θ) + y*cos(θ)