Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Poland Problems of Applied Sciences, 2015, Vol. 3, pp. 015 – 032 Szczecin dr n. tech. Andrzej Antoni CZAJKOWSKIa,b, Kamil SIDORKIEWICZa a University of Szczecin, Faculty of Mathematics and Physics, Department of Informatics and Technical Education (graduate) Uniwersytet Szczeciński, Wydział Matematyczno-Fizyczny, Katedra Edukacji Informatycznej i Technicznej (absolwent) b Higher School of Technology and Economics in Szczecin, Informatics and Technical Education Wyższa Szkoła Techniczno-Ekonomiczna w Szczecinie, Edukacja Informatyczno-Techniczna ANALYTICAL AND NUMERICAL SOLVING OF GENERAL TRIANGLES WITH APPLICATION OF NUMERICAL PROGRAMS MS-EXCEL, MATHCAD AND MATHEMATICA Abstract Introduction and aims: The paper shows the analytical models of solving some general triangles with appropriate discussion. For general triangles have been discussed four cases. The main aim of this paper is not only to create some analytical algorithms for solving general triangle, but also their implementation in programs MS-Excel, MathCAD and Mathematica. Material and methods: Elaboration of four analytical cases of solving the general triangles has been made on the basis of the relevant trigonometric properties occurring in a general triangle. In the paper have been used some analytical and numerical methods by using MS-Excel, MathCAD and Mathematica programs. Results: As some results have been obtained numerical algorithms in the programs MS-Excel, MathCAD and Mathematica for four analytical cases of solving the general triangles. Conclusion: Created numerical algorithms of solving the general triangles in the programs MSExcel, MathCAD and Mathematica allow for faster significant performance calculations than the traditional way of using logarithms and logarithmic tables. Key-words: Trigonometry, solving of general triangles, numerical algorithms, MS-Excel, MathCAD, Mathematica. (Received: 01.05.2015; Revised: 15.05.2015; Accepted: 01.06.2015) ANALITYCZNO-NUMERYCZNE ROZWIĄZYWANIE TRÓJKĄTÓW DOWOLNYCH Z ZASTOSOWANIEM PROGRAMÓW MS-EXCEL, MATHCAD i MATHEMATICA Streszczenie Wstęp i cele: W pracy pokazano analityczne modele rozwiązywania trójkątów dowolnych wraz z odpowiednią dyskusją. Dla trójkątów dowolnych omówiono cztery przypadki. Głównym celem jest pracy jest nie tylko utworzenie algorytmów analitycznych rozwiązywania takich trójkątów lecz również ich implementacja w programach MS-Excel, MathCAD i Mathematica. Materiał i metody: Opracowanie czterech analitycznych przypadków rozwiązywania trójkątów dowolnych wykonano opierając się odpowiednich własnościach trygonometrycznych występujących w trójkącie dowolnym. Zastosowano metodę analityczną i numeryczną wykorzystując programy MS-Excel, MathCAD i Mathematica. Wyniki: Otrzymano algorytmy numeryczne w programach MS-Excel, MathCAD i Mathematica dla czterech analitycznych przypadków rozwiązywania trójkątów dowolnych. Wniosek: Utworzone algorytmy numeryczne rozwiązywania trójkątów dowolnych w programach MS-Excel, MathCAD oraz Mathematica, pozwalają na znaczne szybsze wykonanie obliczeń niż drogą tradycyjną z użyciem logarytmów i tablic logarytmicznych. Słowa kluczowe: Trygonometria, rozwiązywanie trójkątów dowolnych, algorytmy numeryczne, MS-Excel, MathCAD, Mathematica (Otrzymano: 01.05.2015; Zrecenzowano: 15.05.2015; Zaakceptowano: 01.06.2015) © A.A. Czajkowski, K. Sidorkiewicz 2015 Trigonometry / Trygonometria A.A. Czajkowski, K. Sidorkiewicz 1. Introduction to trigonometry 1.1. Types of triangles and basic properties Before we begin the analysis of solving the general triangles, let us look at the types triangles (Fig. 1) and the basic conditions of existence of the triangle (Theorem 1). Triangles division of due to angles sides two sides equal all sides of different lengths equilateral isosceles triangle triangle differentsided all interior angles acute one right angle one obtuse angle all sides equal acute triangle rightangled triangle obtuse triangle triangle a b c a b • a c c b a a a a b b c b a Fig. 1. Types of triangles Source: Elaboration of the Authors basing on [4], [8], [20], [22] & [28] Theorem 1. (Basic properties in the triangle) [2], [6] In any length of each side of the triangle is less than the sum of the length of the other side and higher than the absolute value of the difference in length of the sides. This fact is written by the following conditions: 16 |b − c| < a < b + c , (1) |a −c| < b < a + c , (2) |a − b| < c < a + b . (3) Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica 1.2. Properties in general triangle The general triangle has six basic elements, i.e. three sides a, b and c and three angles α, β and γ. The solution of general triangle involves the determination of three basic elements form six elements, if we have three other. To solve the general triangles should be used theorems of sines, cosines and tangents of half angle function. • Theorem of sines and cosines In solving the general triangles are used of sines and cosines formulas. These formulas are presented in the sines and cosines theorems. Theorem 2. Theorem of sines (Snellius) The sides and angles of any triangle satisfy the following system of equations [5], [10]-[14]: α + β + γ = 180°, (4) a b c = = . sin(α) sin(β) sin( γ ) (5) Theorem 3. Theorem of sines (Snellius) In any triangle, the ratio of the length of any side of the triangle to the sine of the angle opposite this side is constant and equal to the diameter of the circle which is circumscribed on this triangle [5], [10]-[14]: a b c = = = 2R , sin(α) sin(β) sin( γ ) (6) where R is the radius of the circle circumscribed on a given triangle (Fig. 1). The equality (6) is called the formula of sines. C γ c b α O 2R β B a A Fig. 2. A circle circumscribed on the triangle Source: Elaboration of the Authors basing on [10] 17 A.A. Czajkowski, K. Sidorkiewicz Theorem 4. Theorem of cosines (Carnot) In any triangle, the square of the length of any side equals the sum of the squares of the lengths of the other two sides decreased by twice the product of these two sides lengths and the cosine of their included angle [4], [17], [24], [25]. Theorem 5. Theorem of cosines (Carnot) The sides and angles of any triangle satisfy the following system of equations [4], [24], [25]: a 2 = b 2 + c 2 − 2bc ⋅ cos(α), (7) b 2 = a 2 + c 2 − 2ac ⋅ cos(β), (8) c 2 = a 2 + b 2 − 2ab ⋅ cos( γ ). (9) The equalities (7) - (9) are called the formulas of cosines. Corollary 1. If in the formulas of cosines one of the angles is a right angle, the cosine theorem takes on its familiar form known as the Pythagorean theorem [4], [17], [24], [25]. a 2 = b2 + c2 , (10) b 2 = a 2 + c2 , (11) c2 = a 2 + b 2 . (12) • Theorems on any triangle Theorem 6. (Regiomontan) The sides and angles of any triangle satisfy the following system of equations [4], [8], [20]: α −β tg = 2 α−γ tg = 2 a−b γ ctg , a + b 2 (13) a − c β ctg , a + c 2 (14) β − γ b −c α tg ctg . = 2 b+c 2 (15) The equalities (13) - (15) are called the formulas of tangents. Theorem 7. (The half-angle) The sides and angles of any triangle satisfy the following system of equations [4], [8], [20]: α tg = 2 (p − b)(p − c) p(p − a) (16) (p − a)(p − c) β tg = p(p − b) 2 (17) γ tg = 2 (18) (p − a)(p − b) p(p − c) Equalities (16) - (18) are called the formulas of the half angle. 18 Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica 1.3. Cases of solving the general triangles For the general triangle ABC shown in figure 2, there are four cases of solving which are given below (Tab. 1). Let us consider any given general triangle ABC. C γ b A a β α B c Fig. 3. Scheme of the triangle ABC Source: Elaboration of the Authors For the general triangle ABC, shown in figure 3, there are four cases of solving which are given below in the table 1. Table 1. Cases of solving the general triangles [4], [8], [20] Case: Data: Unknown: a, β, γ b, c, α side, angle, angle side, angle, angle Side and angles adjacent to it Two sides and angle a, b, α c, β, γ side, side, angle side, angle, angle The two sides and the contained angle between them Side and two angles a, b, γ c, α, β side, side, angle side, angle, angle The two sides and the angle adjacent to one of them Side and two angles a, b, c α, β, γ side, side, side angle, angle, angle Three sides Three angles I II III IV Source: Elaborated by the Authors 1.4. Discussion of general triangles solutions In the general triangle there is six characterized sizes of this triangle (three angles α, β, γ and three sides a, b, c). If we have three given elements of a general triangle, the other three can be determined in accordance with the table 2. 19 A.A. Czajkowski, K. Sidorkiewicz Table 2. Discussion of solving the general triangles [4], [5], [8], [19], [20], [22], [28] Case: Given data: I a, β, γ Solution: α = 180° − (β + γ) , b = a ⋅ sin(β) , c= sin(α) a ⋅ sin( γ ) sin(α) One solution γ = 180° − (α + β) 1) a > b c= II a, b, α sin(β) = Two solutions β1 γ1 = 180° − (α + β1) b ⋅ sin( α ) a Hence we calculate a ⋅ sin( γ ) sin(α) 2) b⋅sin(α) < a < b c1 = a ⋅ sin( γ1 ) sin(α) β2 = 180° − β1 γ2 = 180° − (α + β2) the angle β c2 = a ⋅ sin( γ 2 ) sin(α) 3) a = b⋅sin(α) One solution β = 90° γ = 90° − α c = b⋅cos(α) 4) a < b⋅sin(α) There is no any solution 1) c2 = a2 + b2 – 2ab⋅cos(γ) Hence we calculate a length of the side c If a > b, then sin(β) = III a, b, γ b ⋅ sin( γ ) c Thence we calculate the angle β α = 180° − (β + γ) 2) tg α − β = a − b ctg γ 2 a + b 2 Hence we calculate having α + β = 90° − γ we find the angles: α, β 2 2 α −β and 2 Side c = a ⋅ sin( γ ) sin(α) 2 2 2 b 2 + c2 − a 2 a 2 + b 2 − c2 , cos(β) = a + c − b , cos(γ ) = 2bc 2ab 2ac Hence we calculate the angles: α, β, γ 1) cos(α) = IV a, b, c 2) a + b + c = 2p (perimeter of the triangle) α tg = 2 (p − b)(p − c) , β (p − a)(p − c) , tg = p(p − a) p(p − b) 2 γ tg = 2 (p − a)(p − b) Thence we calculate the angles: α, β, γ p(p − c) Source: Elaborated by the Authors 20 Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica 2. Solving of general triangles 2.1. The first case – Given one side and two angles adjacent to that side Solve any triangle having the side and angles adjacent to this side (in short ASA). 2.1.1. Theoretical analysis C a γ b β α A B c Fig. 4. Scheme of general triangle ABC with given side c and the angles α and β Source: Elaboration of the Authors Data in ∆ ABC: The length of the side c and measure of the angles α and β. Search in ∆ ABC: The length of the sides a and b and measure of the angle γ. Solution: ♦ Based on the properties of the angles in given triangle we calculate the angle γ: γ = π − ( α + β) . ♦ Using the theorem of sines we determine the side a: a c = sin(α) sin( γ ) hence c ⋅ sin(α) a= sin( γ ) (19) (20) (21) and after taking into account the formula (19) we obtain: a= c ⋅ sin(α) . sin[π − (α + β)] (22) ♦ Using again the theorem of sines we determine the side b: b c = sin(β) sin( γ ) thence b= (23) c ⋅ sin(β) sin(γ ) (24) and after taking into account the formula (19) we have: c ⋅ sin(β) . sin[π − (α + β)] Answer: The requested unknowns are finally defined by the following formulas: b= sides a= c ⋅ sin(α) , sin[π − (α + β)] b= c ⋅ sin(β) sin[π − (α + β)] and angle (25) γ = π − ( α + β) . 21 A.A. Czajkowski, K. Sidorkiewicz 2.1.2. Numerical algorithms in MS-Excel, MathCAD and Mathematica programs For numerical analysis, we assume that in the general triangle we have the following data: length of the side c = 13,5 and measure of the angles α = 44° and β = 38,641°. ♦ Program MS-Excel [3], [9], [16], [18], [23] Algorithm: Commentary: B2=13,5 Given length of the side c B3=44 Given measure of the angle α [º] B4=38,641 Given measure of the angle β [º] B5=(B3*PI())/180 Command for the angle α=0,767945[rad] B6=(B4*PI()/180) Command for the angle β=0,674413[rad] B7=PI()-(B5+C6) Command for the angle γ=1,699 [rad] B8=B7*180/PI() Command for the angle γ=97,359 [°] B9=B2*SIN(B5)/SIN(B7) Command for a side a B10=B2*SIN(B6)/SIN(B7) Command for a side b 97,359 Result: calculated measure of the angle γ [°] 9,455775 Result: calculated length of the side b 8,499936 Result: calculated length of the side a ♦ Program MathCAD [15], [21], [29] Algorithm: Commentary: c:=13.5 Given length of the side c α0:=44 Given measure of the angle α [º] β0:=38.641 Given measure of the angle β [º] α := α0 ⋅ π = 0.767945 180 Command and result: calculated measure of the angle α [rad] β := β0 ⋅ π = 0.674413 180 Command and result: calculated measure of the angle angle β [rad] γ := π − (α + β) = 1.699 Command and result: calculated measure of the angle angle γ [rad] γ := α ⋅ 180 = 97.359 π Command and result: calculated measure of the angle angle γ [°] a := c ⋅ sin(α) = 9.455775 sin( γ ) Command and result: calculated length of the side a b := c ⋅ sin(β) = 8.499936 sin( γ ) Command and result: calculated length of the side b 22 Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica ♦ Program Mathematica [1], [7], [26], [27] Algorithm: Commentary: c:=13.5 Given length of the side c A0:=44 Given measure of the angle α [º] B0:=38.641 Given measure of the angle β [º] A=N[A0*Pi/180]; Command for the angle α=0,767945[rad] B=N[B0*Pi/180]; Command for the angle β=0,674413[rad] G=Pi-(A+B); Command for the angle γ=1,69924 [rad] G1=A*180/Pi Command for the angle γ [°] a=c*SIN(A)/SIN(G) Command for the side a b=c*SIN(B)/SIN(G) Command for the side b 97.359 Result: calculated measure of the angle γ [°] 9.45577 Result: calculated length of the side a 8.499936 Result: calculated length of the side b ♦ Summary of the results Data: Result of calculation: side c angle α [º] angle β [º] angle γ [º] side a side b 13,5 44 38,641 97,359 9,45577 8,499936 Verification: α + β + γ = 180º ⇔ 44º + 38,641º + 97,359º = 180º |b − c| < a < b + c ⇔ 5,00006 < 9,45577 < 21,999936 |a − c| < b < a + c ⇔ 4,04423 < 8,499936 < 22,95577 |a − b| < c < a + b ⇔ 0,955834 < 13,5 < 17,955706 2.2. The second case – Given two sides and the angle included between them Solve the general triangle having two sides and the angle included between them (in short SAS). 2.2.1. Theoretical analysis C b a γ β α A B c Fig. 5. Scheme of the triangle ABC with given sides a and c and angle γ Source: Elaboration of the Authors 23 A.A. Czajkowski, K. Sidorkiewicz Data in ∆ABC: The length of the sides a and b and measure of the angle γ. Search in ∆ABC: The length of the side c and measure of the angles α and β. Solution: ♦ Using the theorem of cosines we determine the side c: c2 = a 2 + b 2 − 2ab ⋅ cos( γ ) , (26) c = a 2 + b 2 − 2ab ⋅ cos( γ ) . (27) hence ♦ Using the theorem of sines we determine the angle α: c a = , sin( γ ) sin(α) (28) a sin( γ ) . c (29) hence sin(α) = Using the inverse sine function, we have: a α = arcsin sin( γ ) . c (30) After taking the formula (27) in (30) we get: a ⋅ sin( γ ) α = arcsin a 2 + b 2 − 2ab ⋅ cos( γ ) . (31) ♦ From property angles of a triangle we have: β = π − ( α + γ ), (32) thus asin( γ ) β = π − α + arcsin a 2 + b 2 − 2ab ⋅ cos( γ ) . (33) Answer: The requested unknowns are finally defined by the following formulas: side angels c = a 2 + b 2 − 2ab ⋅ cos( γ ) a ⋅ sin( γ ) α = arcsin a 2 + b 2 − 2ab ⋅ cos( γ ) a ⋅ sin( γ ) , β = π − γ + arcsin a 2 + b 2 − 2ab ⋅ cos( γ ) 2.2.2. Numerical algorithms in programs MS-Excel, MathCAD and Mathematica For numerical analysis, we assume that in the general triangle we have the following data: length of the sides a = 9,455775 and b = 8,499936 and measure of the angle γ = 97,359°. Note: If a > b, then there is one solution (Tab. 2). 24 . Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica ♦ Program MS-Excel [3], [9], [16], [18], [23] Algorithm: Commentary: B2=9,455775 Given length of the side a B3=8,499936 Given length of the side b B4=97,359 Given measure of the angle γ [º] B5=97,359*PI()/180 Command for the angle γ=1,699 [rad] B6=PIERWIASTEK(B2^2+B3^2-2*B2*B3*COS(B5)) Command for the side c B7=ASIN(B2*SIN(B5)/B6) Command for the angle α [rad] B8=PI()-(B5+B7) Command for the angle β [rad] B9=B7*180/PI() Command for the angle α [°] B10=B8*180/PI() Command for the angle β [°] 13,5 Result: calculated measure of the side c 44 Result:calculated measure of the angle α [°] 38,641 Result: calculated measure of the angle β [°] ♦ Program MathCAD [15], [21], [29] Algorithm: a:=9.455775 b:=8.499936 γ1:=97.359 γ1 ⋅ π = 1.699235 γ := 180 Commentary: Given length of the side a Given length of the side b Given measure of the angle γ [º] Command and result: calculated measure of the angle γ [rad] c := (a 2 + b 2 − 2abcos(γ ))0.5 = 13.500001 Command and result: side c a ⋅ sin( γ ) α1 := asin = 0.767 c Command and result: calculated measure of the angle angle α [rad] β1 := π − (α + γ ) = 0.674413 Command and result: calculated measure of the angle angle β [rad] Command and result: calculated measure of the angle angle α [°] α1 ⋅ π = 44 180 β1 ⋅ π β := = 38.641 180 α := Command and result: calculated measure of the angle angle β [°] ♦ Summary of the results Data: side a 9,455775 side b 8.499936 Result of calculation: angle γ [º] 97,359 side c 13,5 angle α [º] 44 angle β [º] 38,641 Verification: α + β + γ =180º |b − c| < a < b + c |a − c| < b < a + c |a − b|< c < a +b ⇔ ⇔ ⇔ ⇔ 44º + 38,641º + 97,359º = 180º 5, 000064 < 9, 455775 < 21,999936 4, 044225 < 8, 499936 < 22,955775 0,955839 < 13,5 < 17,955711 25 A.A. Czajkowski, K. Sidorkiewicz ♦ Program Mathematica [1], [7], [26], [27] Algorithm: Commentary: a:=9.455775 Given length of the side a b:=8.499936 Given length of the side b G0=97.359 Given measure of the angle γ [º] G:=G0*Pi/180 Command for the angle γ=1,699 [rad] c=Sqrt[a^2+b^2-2*a*b*Cos[G]] Command for the side c A=ArcSin[a*Sin[G]/c] Command for the angle α [rad] B=Pi-(G+A) Command for the angle β [rad] A*180/Pi; Command for the angle α [°] B*180/Pi; Command for the angle β [°] 13.5 Result: calculated length of the side c 44 Result: calculated measure of the angle α [°] 38.641 Result: calculated measure of the angle β [°] 2.3. The third case – Given two sides and angle adjacent to one of these sides Solve the general triangle having two sides and angle adjacent to one of these sides (in short ASS). 2.3.1. Theoretical analysis C b γ a β A α B c Fig. 6. Scheme of the triangle ABC with given sides a and b and angle α Source: Elaboration of the Authors Data in ∆ABC: The length of the sides a and b and measure of the angle α. Search in ∆ABC: The length of the side c and measure of the angles β and γ. Solution: ♦ Using the theorem of sines we determinate the angle β : a b = , sin(α) sin(β) (34) Hence using the inverse sine function, we have: b ⋅ sin(α) β = arcsin . a 26 (35) Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica ♦ From the property angles of a triangle we have γ = π − ( α + β), (36) b ⋅ sin(α) γ = π − α + arcsin . a (37) hence ♦ Using the theorem of cosines we determine the side c: c 2 = a 2 + b 2 − 2ab ⋅ cos( γ ) . (38) ♦ After taking the formula (37) in (38) we obtain: b ⋅ sinα c 2 = a 2 + b 2 − 2ab ⋅ cos π − α + arcsin a which, after appropriate transformations gives: b ⋅ sin(α) c = a 2 + b 2 + 2ab ⋅ cosα + arcsin . a (39) (40) Answer: The requested unknowns are finally defined by the following formulas: side & angels b ⋅ sin(α) b ⋅ sin(α ) b ⋅ sin(α) c = a 2 + b 2 + 2ab ⋅ cos α + arcsin , γ = π − α + arcsin , β = arcsin . a a a 2.3.2. Numerical algorithms in programs MX-Excel, MathCAD and Mathematica For numerical analysis, we assume that in the general triangle we have the following data: length of the sides a = 9,455775 and b = 8,499936 and measure of the angle α = 44° ♦ Program MS-Excel [3], [9], [16], [18], [23] Algorithm: Commentary: B2=9,455775 Given length of the side a B3=8,499936 Given length of the side b B4=44 Given measure of the angle α [º] B5=B4*PI()/180 Command for the angle α [rad] B6=ASIN(B3+SIN(B5)/B2) Command for the angle β [rad] B7=B6*180/PI() Command for the angle β [º] B8=PI()-(B5+B6) Command for the angle γ [rad] B9=B8*PI()/180 Command for the angle γ [°] B10=PIERWIASTEK(B2^2+B3^2-2*B2*B3*COS(B5)) Command for the side c 38,641 Result: calculated measure of the angle β [°] 97,359 Result: calculated measure of the angle γ [°] 13,5 Result: calculated length of the side c 27 A.A. Czajkowski, K. Sidorkiewicz ♦ Program MathCAD [15], [21], [29] Algorithm: Commentary: a: = 9.455775 Given length of the side a b: = 8.499936 Given length of the side b α: = 44 Given measure of the angle α [º] α1 := α⋅π = 0.767945 180 Command and result: calculated measure of the angle α [rad] b ⋅ sin(α1) β1 := asin = 0.674413 a β := β1 ⋅ 180 = 38.641 π Command and result: calculated measure of the angle β [°] γ1 := π − (α1 + β1) = 1.699235 γ := Command and result: calculated measure of the angle β [rad] Command and result: calculated measure of the angle γ [rad] γ1 ⋅ 180 = 97.359 π Command and result: calculated measure of the angle γ [°] c := a 2 + b 2 − 2 ⋅ a ⋅ b ⋅ cos( γ1) = 13.5 Command and result: calculated length of the side c ♦ Program Mathematica [1], [7], [26], [27] Algorithm: a:=9.455775 Given length of the side a b:=8.499936 Given length of the side b A=44 Given measure of the angle α [º] A1:=A*Pi/180 Command for the angle α [rad] B1:=ArcSin[(b*Sin[A1]/a] Command for the angle β [rad] B=B1*180/Pi Command for the angle β [°] G1=Pi-(A1+B1); Command for the angle γ [rad] G=G1*180/Pi Command for the angle γ [°] c=Sqrt[a^2+b^2-2*a*b*Cos[G]] Command for the side c 38,641 Result: calculated measure of the angle β [°] 97,359 Result: calculated measure of the angle γ [°] 13,5 Result: calculated length of the side c Commentary: ♦ Summary of the results Data: side a 9,455775 side b 8.499936 Result of calculation: angle α [º] 44 side c 13,5 angle β [º] 38,641 Verification: α + β + γ = 180º ⇔ 44º + 38,641º + 97,359º = 180º | b − c | < a < b + c ⇔ 5,00006 < 9,45577 < 21,999936 | a − c | < b < a + c ⇔ 4,04423 < 8,499936 < 22,95577 | a − b | < c < a + b ⇔ 0,955834 < 13,5 < 17,955706 28 angle γ [º] 97,359 Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica 2.4. The fourth case – Given three sides Solve the general triangle having three sides (in short SSS). 2.4.1. Theoretical analysis C b A a γ β α B c Fig. 7. Scheme of the triangle ABC with given sides a, b and c Source: Elaboration of the Authors Data in ∆ABC: The length of the sides a, b and c. Search in ∆ABC: The measure of the angels α, β and γ. Solution: ♦ Using the theorem of cosines we determinate the angle α: a 2 = b 2 + c 2 − 2bc ⋅ cos(α) , (41) hence b 2 + c2 − a 2 cos(α) = . 2bc Using the inverse cosine function, we get: b2 + c2 − a 2 . α = arccos 2bc (42) (43) ♦ Using again the theorem of cosines we determinate the angle β: b 2 = a 2 + c 2 − 2ac ⋅ cos(β) , (44) hence a 2 + c2 − b 2 . 2ac Using again the inverse cosine function, we get: cos(β) = a 2 + c2 − b2 . β = arccos 2ac (45) (46) Taking into account a property angles of a triangle we determine the angle γ: γ = π − (α + β) (47) Answer: The requested unknowns are finally defined by the following formulas: Angels 2 2 2 b 2 + c2 − a 2 2 2 2 2 2 2 , β = arccos a + c − b , γ = π − arccos b + c − a + arccos a + c − b . α = arccos 2bc 2ac 2bc 2ac 29 A.A. Czajkowski, K. Sidorkiewicz 2.4.2. Numerical algorithms in programs MX-Excel, MathCAD and Mathematica For numerical analysis, we assume that in the general triangle we have the following data: lengths of the sides: a = 9,455775; b = 8,499936 and c = 13,5. ♦ Program MS-Excel [3], [9], [16], [18], [23] Algorithm: Commentary: B2=9,455775 Given length of the side a B3=8,499936 Given length of the side b B4=13,5 Given length of the side c B5=ACOS(((B3^2+B4^2-B2^2)/(2*B3*B4)) Command for the angle α [rad] B6=ACOS(((B2^2+B4^2-B3^2)/(2*B2*B4)) Command for the angle β [rad] B7=PI()-(B5+B6) Command for the angle γ [rad] B8=B5*180/PI() Command for the angle α [°] B9=B6*180/PI() Command for the angle β [°] B10=B7*180/PI() Command for the angle γ [°] 44,000001 Result: calculated measure of the angle α [°] 38,641003 Result: calculated measure of the angle β [°] 97,358993 Result: calculated measure of the angle γ [°] ♦ Program MathCAD [15], [21], [29] Algorithm: Commentary: a:=9.455775 Given length of the side a b:=8.499936 Given length of the side b c:=13.5 Given length of the side c b2 + c2 − a 2 = 0.767945 α1 := acos 2⋅b⋅c Command and result: calculated measure of the angle α [rad] a 2 + c2 − b2 = 0.674413 β1 := acos 2ac Command and result: calculated measure of the angle β [rad] γ1 := π − (α + β) = 1.699235 Command and result: calculated measure of the angle γ [rad] α := α1 ⋅ 180 = 44.000004 π Command and result: calculated measure of the angle α [°] β := β1 ⋅ 180 = 38.641003 π Command and result: calculated measure of the angle β [°] γ := γ1 ⋅ 180 = 97.358993 π Command and result: calculated measure of the angle γ [°] 30 Analytical and numerical solving of general triangles with application of numerical programs MS-Excel, MathCAD and Mathematica ♦ Program Mathematica [1], [7], [26], [27] Algorithm: Commentary: a:=9.455775 Given length of the side a b:=8.499936 Given length of the side b c:=13.5 Given length of the side c A1=ArcCos[(b^2+c^2-a^2)/(2*b*c)]; Command for the angle α [rad] B1=ArcCos[(a^2+c^2-b^2)/(2*a*c)]; Command for the angle β [rad] C1=Pi-(A1+B1); Command for the angle γ [rad] A1*180/Pi Command for the angle α [°] B1*180/Pi Command for the angle β [°] C1*180/Pi Command for the angle γ [°] 44 Result: calculated measure of the angle α [°] 38.641 Result: calculated measure of the angle β [°] 97.359 Result: calculated measure of the angle γ [°] ♦ Summary of the results Data: side a 9,455775 Result of calculation: side c angle α [º] angle β [º] 13,5 44 38,641 Verification: α + β + γ = 180º ⇔ 44º + 38,641º + 97,359º = 180º | b − c | < a < b + c ⇔ 5,00006 < 9,45577 < 21,999936 side b 8,499936 |a − c| < b < a + c ⇔ 4,04423 < 8,499936 < 22,95577 |a − b| < c < a + b ⇔ 0,955834 < 13,5 < 17,955706 angle γ [º] 97,359 3. Conclusions • Discussed analytical models of solving the general triangles allow to perform the other theoretical considerations in each of the four basic cases, taking into account the definition of trigonometric functions and the corresponding properties and patterns. • Created numerical algorithms of solving the general triangles in MS-Excel, MathCAD, and Mathematica programs allow for significant execution of faster calculations than the traditional way of using logarithms and logarithmic tables. • Problem of solving the general triangles finds wide applications in technical sciences and related fields. 31 A.A. Czajkowski, K. Sidorkiewicz Literature [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] 32 Abel M.L., Braselton J.P.: Mathematica by example, Revised edition. Georgia Southern University, Department of Mathematics and Computer Science, Statesboro, Georgia, AP Professional A Division of Harcourt Brace & Company, Boston San Diego New York London Sydney Tokyo Toronto 1993. Aufmann R.N., Barker V.C., Nation R.D.: College trigonometry. Houghton. 2004. Bourg D.M.: Excel w nauce i technice. Receptury, HELION, Gliwice 2006. Bronsztejn I.N., Siemiendiajew K.A., Musiol G., Mühlig H.: Nowoczesne kompendium matematyki. Wyd. Naukowe PWN, Warszawa 2004. Czajewicz A.: Trygonometryja płaska i kulista, W Drukarni Noskowskiego, Warszawa 1811. Dolciani Mary P., Berman Simon L., Wooton William, Meder Albert E.: Modern algebra and trigonometry. Structure and Method. Book Two. Houghton Mifflin Company, Boston New York Atlanta Geneva, Ill. Dallas Palo Alto 1965. Drwal G., Grzymkowski R., Kapusta A., Słota D.: Mathematica 4, Wyd. Pracowni Komputerowej Jacka Skalmierskiego, Gliwice 2000. Gellert W., Küstner H., Hellwich M., Kästner H.: Kleine Enzyklopädie Mathematik. VEB Bibliographisches Institut Leipzig, Leipzig 1986, 13., unveränderte Auflage. Gonet M.: Excel w obliczeniach naukowych i inżynieryjnych. Helion, Gliwice 2010. Górski J.: Zarys trygonometrii dla techników ekonomicznych. PWSZ, Warszawa 1956. Górski J.: Trygonometria dla zasadniczej szkoły zawodowej. PWSZ, Warszawa 1951. Górski J., Romanowski M.: Geometria z trygonometrią dla klasy 1 techników przemysłowych. PWSZ, Warszawa 1955. Gutkowski T.: Trygonometrja z licznymi ćwiczeniami. Licencjat Uniwersytetu Paryskiego, Wydawnictwo M. ARCTA w Warszawie, 1917. Hall H.S., Knight S.R.: Elementary trygonometry, MacMillan & Co. Limited, London New York 1906. Jakubowski K.: MathCAD 2000 Professional, Wyd. EXIT, Warszawa 2000. Jelen B.: Microsoft Excel 2007 PL. Wykresy jako wizualna prezentacja informacji. Wyd. Helion, Gliwice 2008. Kaufmann J.E.: Algebra with trigonometry for college students. Prindle, Weber and Schmith, 1985. McFedries P.: Microsoft Excel 2007 PL. Formuły i funkcje. Wyd. Helion, Gliwice 2008. Neill Hugh: Trigonometry. A complete introduction. Teach Yourself, 2013. Nowosiłow S.I.: Specjalny wykład trygonometrii. PWN, Warszawa 1956. Paleczek W.: MathCAD 12, 11, 2001i, 2001, 2000 w algorytmach, Akademicka Oficyna Wydawnicza EXIT, Warszawa 2005. Pokorny E.J.: Trygonometria dla samouków. PZWS, Warszawa 1962. Smogur Zb.: Excel w zastosowaniach inżynieryjnych. Helion, Gliwice 2008. Sworkowski: Precalculus: Algebra and trigonometry. Prindle, Weber & Schmith, 1986. Sworkowski: Fundamentals of algebra and trigonometry. Sixth edition. Prindle, Weber & Schmith, 1986. Trott M.: The Mathematica guide book for symbolics, Springer, New York 2006. Wolfram S.: The Mathematica Book, 4th edition, Wolfram Media and Cambridge University Press, Champaign and Cambridge 1999. Wojtowicz Wł.: Trygonometria. PZWS, Warszawa 1948, wyd. V. Young J.W., Morgan F.M.: Plane trygonometry and numerical computation, The MacMillan Company, New York 1919.