%% () Calculates the difference (in x and y components of a vector in m) between destinations resulting from two different compass bearings. %% Calculates the formula for a shape's property based on trigonometry /** c2 =(b-x)2 +h2, and a2 =x2 +h2 so that c2 - (b-x)2 = h2 and a2 – x2 = h2 By the transitive property c2 - (b-x)2 = a2 – x2 Expanding (b-x)2 c2 – b2 + 2bx – x2 = a2 – x2 c2 = a2 + b2 – 2bx Figure 2 Now eliminate x from the equation by substituting a value of x which involves the cosine of C. CosC = x/a-----> x = aCosC c2=a2 +b2 –2b(aCosC) c2=a2 +b2 –2abCosC **/ %% Calculates a list of right-angle triangles from a chart %% chart_to_ratl([D,E,F],[[C,D,E],[A,E,F],[ %% chart_to_ratl(+Points,+Relations,+RightAngles,-RightAngleTriangles) %% Points - e.g. D, E, F, G around a shape %% Relations - e.g. list of [C, D, E], in which C is the line label, for the line between points D and E %% RightAngles - e.g. list of [D, G, E], in which there is a right angle between D, G and E %% RightAngleTriangles - e.g. list of [D, G, E], in which D, G and E form a right-angle triangles. chart_to_ratl(Points,Relations,RightAngles,RightAngleTriangles) :-