Given angles(in degrees) A, C, and the side c, corresponding to the figure below, the task is to find the remaining two sides a and b.
Input: A = 45, C = 35, c = 23 Output: 28.35 39.49 Explanation: a is 28.35 and b is 39.49
Input: A = 45, C = 45, c = 10 Output: 10 14.14
Approach: The idea is to use Sine rule. It states that the sides of any triangle are proportional to the sine of the angles opposite to them. a / Sin(A) = b / Sin(B) = c / Sin(C). The derivation is described below:
As is evident from the figure above:
A perpendicular of length h has been drawn on BC from A. From General trigonometric rules:
From the above two equations, we get:
c x SinB=b x SinC
Similarly, if a perpendicular is drawn from B to AC, we can get:
From Equations (3) and (4), we get:
Follow the steps below to solve the problem:
Change the angles A and C from degrees to radians to be able to be used in the inbuilt functions.
Calculate the angle B using the observation that sums of angles of a triangle sums up to 180 degrees.
Use the Sine rule to calculate the sides a and b.
Below is the implementation of the above approach:
Please Login to comment...