I'm having a pain with trig at the moment.
double angle = tan(opposite/adjacent);
angle = (angle) * (180.0 / M_PI);
That finds the angle for them particulars, we'll say in this case it equals 15.18º after being converted from radians.
Then, to find the adjacent and opposite of the new Hypotenuse with the same angle I do..
double oppAngle = sin(angle);
double adjAngle = cos(angle);
double secondOpposite = newDistance * oppAngle;
double secondAdjacent = newDistance * adjAngle;
NSLog(@"opposite = %.2f * %.2f = %.2f", oppAngle, newDistance, secondOpposite);
NSLog(@"Adjacent = %.2f * %.2f = %.2f", adjAngle, newDistance, secondAdjacent);
That logs,
2015-06-27 17:36:14.565 opposite = -0.51 * 183.27 = -92.94
2015-06-27 17:36:14.565 Adjacent = -0.86 * 183.27 = -157.95
Which is obviously wrong, as the sine and cosine of them angles are incorrect. The angle logs 15.18º so I'm not too sure where I'm going wrong, unless.. They are converted into radians again? I'm not quite sure where I'm going wrong, however.. It's wrong.
The trig formula is
tan(angle) = opposite / adjacent
So to get the angle from the side lengths, you need to use the inverse tangent, which is atan2.
double angle = atan2(opposite, adjacent);
From there the rest of your code works as long as you know that atan2 returns an angle in radians (so your second line is unnecessary).