Hello,
Is there a reason you are breaking it into 4 quadrants?
You may be making things more difficult for yourself. Your approach seems sound but the method may need adjusting.
It's easier for me if I think in terms of an elypse or circle. I'll say the Hypotenuse is really a representation of a radius - the distance from the sun to any particular body or planet. For my example, I don't need to care about quadrant - I can pick that up later depending on the position of a planet. So far so good?
Ok, a point on a circle (orbit) can be represented in 2d cartesian coordinates with
x=radius*cos(angle to x axis)+center x offset
y=radius*sin(angle to x axis)+center y offset
So, just like you were calculating C (hypotenuse c^2=a^2+b^2), we can calculate the radius from 0,0 to whatever the center of a planet is (let's say 100,100)
let's call x=x , y=y, theta=angle to x axis, r=radius
r=sqrt((100-0)^2+(100-0)^2)=~141
Now all we need is a loop to change the angle and we can calculate the x and y position of the planet whose origin is 100,100
do
theta=wrapvalue(theta+1)
x=r*cos(theta)+0
y=r*sin(theta)+0
rem do something with x and y
loop
That's all you need to calculate the orbit. If you want an eliptical orbit, then you need a second radius to use in the y calculation.
For the quadrants, you can query theta at any given time to see what it's angle is. If it's between 0 and 90, it's in quadrant 1 etc.
Enjoy your day.