Excerpt |
---|
This example illustrates how to apply basic trigonometric functions to your transformations. |
Functions:
D generate list excerpts |
---|
pages | SIN Function,COS Function,TAN Function |
---|
|
The following functions are computed using the above functions:
- Cotangent. Computed as 1/TAN.
- Secant. Computed as 1/COS.
- Cosecant. Computed as 1/SIN.
Also:
D generate list excerpts |
---|
pages | ROUND Function,RADIANS Function |
---|
|
Source:
In the following sample, input values are in degrees:
Transformation:
In this example, all values are rounded to three decimals for clarity.
First, the above values in degrees must be converted to radians.
D trans |
---|
RawWrangle | true |
---|
p03Value | 'rX' |
---|
Type | step |
---|
WrangleText | derive type: single value: round(radians(X), 3) as: 'rX' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | round(radians(X), 3) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Sine:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'SINrX' |
---|
Type | step |
---|
WrangleText | derive type: single value: round(sin(rX), 3) as: 'SINrX' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | round(sin(rX), 3) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Cosine:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'COSrX' |
---|
Type | step |
---|
WrangleText | derive type: single value: round(cos(rX), 3) as: 'COSrX' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | round(cos(rX), 3) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Tangent:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'TANrX' |
---|
Type | step |
---|
WrangleText | derive type: single value: round(tan(rX), 3) as: 'TANrX' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | round(tan(rX), 3) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Cotangent:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'COTrX' |
---|
Type | step |
---|
WrangleText | derive type: single value: round(1 / tan(rX), 3) as: 'COTrX' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | round(1 / tan(rX), 3) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Secant:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'SECrX' |
---|
Type | step |
---|
WrangleText | derive type: single value: round(1 / cos(rX), 3) as: 'SECrX' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | round(1 / cos(rX), 3) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Cosecant:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'CSCrX' |
---|
Type | step |
---|
WrangleText | derive type: single value: round(1 / sin(rX), 3) as: 'CSCrX' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | round(1 / sin(rX), 3) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Results:
X | rX | COTrX | SECrX | CSCrX | TANrX | COSrX | SINrX |
---|
-30 | -0.524 | -1.73 | 1.155 | -1.999 | -0.578 | 0.866 | -0.5 |
0 | 0 | null | 1 | null | 0 | 1 | 0 |
30 | 0.524 | 1.73 | 1.155 | 1.999 | 0.578 | 0.866 | 0.5 |
45 | 0.785 | 1.001 | 1.414 | 1.415 | 0.999 | 0.707 | 0.707 |
60 | 1.047 | 0.578 | 1.999 | 1.155 | 1.731 | 0.5 | 0.866 |
90 | 1.571 | 0 | -4909.826 | 1 | -4909.826 | 0 | 1 |
120 | 2.094 | -0.577 | -2.001 | 1.154 | -1.734 | -0.5 | 0.866 |
135 | 2.356 | -1 | -1.414 | 1.414 | -1 | -0.707 | 0.707 |
180 | 3.142 | 2454.913 | -1 | -2454.913 | 0 | -1 | 0 |
D s also |
---|
label | example_trigonometry_functions |
---|
|