You are currently reviewing an older revision of this page.
In trigonometry, the law of sines (also known as the sine law, sine formula, or sine rule) is an equation relating the lengths of the sides of an arbitrarytriangle to the sines of its angles. According to the law, so given: side a = 20, side c = 24, and angle C = 40° Using the law of sines, we conclude that feature User.Objects.SineRule Bentley.GC.Features.GraphFunction { Definition = function ( //double a, //double b, double c, //double A, double B, double C) { // this is an 80 char long line 34567890//34567890//34567890 // This function returns the length of side 'b' // when given the length of side 'c' and the angles // at 'C' and 'B'. See wikipedia for diagrams. // http://en.wikipedia.org/wiki/Law_of_sines // a b c // ————— = ————— = ————— // sin A sin B sin C // // C // ^ // / \ // / \ // b/ \a // / \ // / \ // / \ // A/_____________\B // c // Given the length of c and the angles at C and B // this function returns the length of side b double b = (c/Sin(C))*Sin(B); return b; }; SymbolXY = {970, 490}; Description = "Returns the length of side 'b' when given the length of side 'c' and the angles at 'C' and 'B'."; } feature User.Objects.RemainingInternalAngleOfTriangle Bentley.GC.Features.GraphFunction { Definition = function (double A, double B) { // this is an 80 char long line 34567890//34567890//34567890 /* This function returns the third internal angle in a * triangle. * The sum of the internal angles of a triangle is * always 180, so the difference between the sum of the * first two and 180 gives the third. * http://bit.ly/fAAceY - diagram * This can be proven quite elegantly by tearing the * corners off a paper triangle and rearanging them to * make a straight line. * http://bit.ly/ebGEZG - diagram */ double C = 180 - (A + B); return C; }; SymbolXY = {590, 480}; Description = "Returns the unknown angle 'C' from a triangle where angles 'A' & 'B' are known"; } feature User.Objects.AngleFromLengthLengthAndAngle Bentley.GC.Features.GraphFunction { Definition = function (double a_in, double b_in, double A_in) { // this is an 80 char long line 34567890//34567890//34567890 /* Given lengths a & b and angle A this function * returns an array of all the lengths and angles * in the triangle. * Idealy this would get returned as an object, * but as far as I know this is beyond GCscript * for the moment. * C * ^ * / \ * / \ * b/ \a * / \ * / \ * / \ * A/_____________\B * c */ double a = a_in * 1000; //scaling is so that the value of B is less double b = b_in * 1000; //than one before it gets given to ArcSine double A = A_in; double Btemp = (b*Sin(A))/a; double B = Asin(B); double C = RemainingInternalAngleOfTriangle(A, B);//180-sum of angles double c = (a*Sin(C))/Sin(A); a = a/1000; b = b/1000; c = c/1000; double values = { A, B, C, a, b, c}; string lables = {"A[1]","B[3]","C[5]","a[7]","b[9]","c[11]"}; object results = Interleave(lables,values); for (int i = 0; i < values.Count; i++) { if ((values[i].Type==typeof(double))==false) { ; } } if (VERBOSE) { Print(results.ToString); } return results; }; SymbolXY = {790, 485}; Description = ""; }
In trigonometry, the law of sines (also known as the sine law, sine formula, or sine rule) is an equation relating the lengths of the sides of an arbitrarytriangle to the sines of its angles. According to the law,