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 r0762

This example illustrates how to apply the inverse trigonometric (Arc) functions to your transformations. 

Info

NOTE: These functions are valid over specific ranges.

  • Arcsine. See ASIN Function.
  • Arccosine. See ACOS Function
  • Arctangent. See ATAN Function.
  • Arccotangent. Computed using ATAN function. See below.
  • Arcsecant. Computed using ACOS function. See below.
  • Arccosecant. Computed using ASIN function. See below.

Source:

In the following sample, input values are in radians. In this example, all values are rounded to two decimals for clarity.


Y
-1.00
-0.75
-0.50
0.00
0.50
0.75
1.00

Transformation:

Arcsine:

Valid over the range (-1 <= Y <= 1)

D trans
RawWrangletrue
p03Value'asinY'
Typestep
WrangleTextderive type: single value: round(degrees(asin(Y)), 2) as: 'asinY'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valueround(degrees(asin(Y)), 2)
p03NameNew column name
SearchTermNew formula

Arccosine: 

Valid over the range (-1 <= Y <= 1)

D trans
RawWrangletrue
p03Value'acosY'
Typestep
WrangleTextderive type: single value: round(degrees(acos(Y)), 2) as: 'acosY'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valueround(degrees(acos(Y)), 2)
p03NameNew column name
SearchTermNew formula

Arctangent: 

Valid over the range (-1 <= Y <= 1)

D trans
RawWrangletrue
p03Value'atanY'
Typestep
WrangleTextderive type: single value: round(degrees(atan(Y)), 2) as: 'atanY'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valueround(degrees(atan(Y)), 2)
p03NameNew column name
SearchTermNew formula

Arccosecant:

This function is valid over a set of ranged inputs, so you can use a conditional column for the computation. For more information, see ASIN Function.

D trans
RawWrangletrue
p03Valueround(degrees(asin(divide(1, Y))), 2)
Typestep
WrangleTextcase condition: ifThenElse if: (Y <= -1) || (Y >= 1) then: round(degrees(asin(divide(1, Y))), 2) as: 'acscY'
p01NameCondition type
p01Valueif...then...else
p02NameIf
p02Value(Y <= -1) || (Y >= 1)
p03NameThen
p04Value'acscY'
p04NameNew column name
SearchTermConditional column

Arcsecant:

Same set of ranged inputs apply to this function. For more information, see ACOS Function.

D trans
RawWrangletrue
p03Valueround(degrees(acos(divide(1, Y))), 2)
Typestep
WrangleTextcase condition: ifThenElse if: (Y <= -1) || (Y >= 1) then: round(degrees(acos(divide(1, Y))), 2) as: 'asecY'
p01NameCondition type
p01Valueif...then...else
p02NameIf
p02Value(Y <= -1) || (Y >= 1)
p03NameThen
p04Value'asecY'
p04NameNew column name
SearchTermConditional column

Arccotangent:

For this function, the two different ranges of inputs have different computations, so an else condition is added to the transformation. For more information, see ATAN Function.

D trans
RawWrangletrue
p03Valueround(degrees(atan(divide(1, Y))), 2)
WrangleTextcase condition: ifThenElse if: Y > 0 then: round(degrees(atan(divide(1, Y))), 2) else: round(degrees(atan(divide(1, Y)) + pi()), 2) as: 'acotY'
p01NameCondition type
p03NameThen
p04Valueround(degrees(atan(divide(1, Y)) + pi()), 2)
SearchTermConditional column
Typestep
p05NameNew column name
p01Valueif...then...else
p02NameIf
p02ValueY > 0
p05Value'acotY'
p04NameElse

Results:

YacotYasecYacscYatanYacosYasinY
-1.00-41.86180.00-90.00-45.00180.00-90.00
-0.75-49.99nullnull-37.00139.00-49.00
-0.50-60.29nullnull-27.00120.00-30.00
0.00nullnullnull0.0090.000.00
0.5063.44nullnull27.0060.0030.00
0.7553.13nullnull37.0041.0049.00
1.0045.000.0090.0045.000.0090.00