I'm trying to calculate the degrees of an angle and the length of the hypotenuse if they were stretched/scaled horizontally or vertically.
Here's a picture to demonstrate.
a = width
b = height
c = length of hypotenuse
α = degrees
I want to find out if there is a possible way to cut down the math I have for calculating the stretched angle below.
Converting degrees to Vector2 like format, and apply the scale.
$\ \theta=\alpha\frac{π}{180} $
$\ x=\cos(θ)a $
$\ y=\sin(θ)b $
Then convert it back to degrees.
$\ \alpha=\operatorname{atan2}(y, x)\frac{180}{\pi} $
Sorry if the way I write my equations is weird, I only have a shallow understanding in writing equations.
Here's an example in code:
void ScaleAngle(float degress, Vector2 size)
{
// Convert degrees to Vector2 and apply scale
float theta = (degress - 90) * (Mathf.PI / 180);
Vector2 v = Vector2(cos(theta), sin(theta)) * size;
// Convert Vector2 back to degrees
float a = atan2(v.y, v.x) * (180 / Mathf.PI) + 90;
return a;
}
I don't know where to start with finding the length of the hypotenuse with the scaling in mind, sorry.
Thank you.

You have found out the parametric representation of points which form an ellipse, where $$x=acosθ,y=bsinθ$$
General equation of an ellipse is $$\frac{x²}{a²} + \frac{y²}{b²} = 1 $$ I think you mistyped the formula in your question for $θ$. $$tan θ= \frac{a}{b}×\frac{y}{x}$$ Or $$θ=tan^{-1}\frac{ay}{bx}$$
And $$c=\sqrt{x²+y²}=\sqrt{a²cos²θ+b²sin²θ}$$
Other than that, it's all correct. This answer to another question proves the parametricity of a and b