Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0821

This example illustrates to use the DEGREES and RADIANS functions to convert values from one unit of measure to the other.

Source:

In this example, the source data contains information about a set of isosceles triangles. Each triangle is listed in a separate row, with the listed value as the size of the non-congruent angle in the triangle in degrees.

You must calculate the measurement of all three angles of each isosceles triangle in radians.

trianglea01
t0130
t0260
t0390
t04120
t05150


Transformation:

You can convert the value for the non-congruent angle to radians using the following:

D trans
RawWrangletrue
p03Value'r01'
Typestep
WrangleTextderive type:single value: ROUND(RADIANS(a01), 4) as: 'r01'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueROUND(RADIANS(a01), 4)
p03NameNew column name
SearchTermNew formula

Now, calculate the value in degrees of the remaining two angles, which are congruent. Since the sum of all angles in a triangle is 180, the following formula can be applied to compute the size in degrees of each of these angles:

D trans
RawWrangletrue
p03Value'a02'
Typestep
WrangleTextderive type:single value: (180 - a01) / 2 as: 'a02'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Value(180 - a01) / 2
p03NameNew column name
SearchTermNew formula

Convert the above to radians:

D trans
RawWrangletrue
p03Value'r02'
Typestep
WrangleTextderive type:single value: ROUND(RADIANS(a02), 4) as: 'r02'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueROUND(RADIANS(a02), 4)
p03NameNew column name
SearchTermNew formula

Create a second column for the other congruent angle:

D trans
RawWrangletrue
p03Value'r03'
Typestep
WrangleTextderive type:single value: ROUND(RADIANS(a02), 4) as: 'r03'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueROUND(RADIANS(a02), 4)
p03NameNew column name
SearchTermNew formula

To check accuracy, you sum all three columns and convert to degrees:

D trans
RawWrangletrue
p03Value'checksum'
Typestep
WrangleTextderive type:single value: ROUND(DEGREES(r01 + r02 + r03), 4) as: 'checksum'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueROUND(RADIANS(a02), 4)
p03NameNew column name
SearchTermNew formula

Results:

After you delete the intermediate columns, you see the following results and determine the error in the checksum is acceptable:

trianglea01r03r02r01checksum
t01301.30951.30950.5238179.9967
t02601.04761.04761.0476179.9967
t03900.78570.78571.5714179.9967
t041200.52380.52382.0952179.9967
t051500.26190.26192.6190179.9967