General Triangle Package Copyright 1995 Lunar Engineering By Ashish Mishra This package solves for various variables of the general triangle equations. These equations are: a^2 = b^2 + c^2 - 2bc*Cos(A) (in various forms you can solve for b and c as well) and a/sin A = b/ Sin B = c/ Sin C Variable names: at_side: a side of the triangle (length units) bt_side: b side of the triangle (length units) ct_side: c side of the triangle (length units) at_angle: angle opposite that of side a (between sides b and c) (angle units) bt_angle: angle opposite that of side b (between sides a and c) ct_angle: angle opposite that of side c (between sides b and c) Note the variable names are simply not a, b, and c. This is because Lunar MathStar uses a search and replace technique for solving equations. Therefore, variable names have to be completely unique. (ie. if a=5 and you have an equation "bad*2", MathStar will replace the letter "a" by it's value and try to solve "b5d*2" and thus produce an error!) Note also we did not use a_side, b_side, c_side. Do you know why? Anything with a "c_" in it is treated as a constant - and will not be displayed in the show variables unless the constants screen is turned on. The following is the actual equation file for this package. Note that the special functions: Pow (x, 2) is equivalent to x^2 (which NewtonScript does not handle) and Sqrt(x) which returns the square root of x. Variable: at_side (units) Type: LENGTH Equation: Sqrt(Pow(bt_side, 2)+ Pow(ct_side, 2)-2*bt_side*ct_side*Cos(at_angle)) Variable: bt_side (units) Type: LENGTH Equation: Sqrt(Pow(at_side, 2)+ Pow(ct_side, 2)-2*at_side*ct_side*Cos(bt_angle)) Variable: ct_side (units) Type: LENGTH Equation: Sqrt(Pow(bt_side, 2)+ Pow(at_side, 2)-2*bt_side*at_side*Cos(ct_angle)) Variable: at_angle (units) Type: ANGLES Equations: Asin(at_side/bt_side*bt_angle) Asin(at_side/ct_side*ct_angle) Variable: bt_angle (units) Type: ANGLES Equations: Asin(bt_side/ct_side*ct_angle) Asin(bt_side/at_side*at_angle) Variable: ct_angle (units) Type: ANGLES Equations: Asin(ct_side/at_side*at_angle) Asin(ct_side/bt_side*bt_angle)