Skip to main content

EXAMPLE - Trigonometry Functions

This example illustrates how to apply basic trigonometric functions to your transformations.

Functions:

Item

Description

SIN Function

Computes the sine of an input value for an angle measured in radians. The value can be a Decimal or Integer literal or a reference to a column containing numeric values.

COS Function

Computes the cosine of an input value for an angle measured in radians. The value can be a Decimal or Integer literal or a reference to a column containing numeric values.

TAN Function

Computes the tangent of an input value for an angle measured in radians. The value can be a Decimal or Integer literal or a reference to a column containing numeric values.

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:

Item

Description

ROUND Function

Rounds input value to the nearest integer. Input can be an Integer, a Decimal, a column reference, or an expression. Optional second argument can be used to specify the number of digits to which to round.

RADIANS Function

Computes the radians of an input value measuring degrees of an angle. The value can be a Decimal or Integer literal or a reference to a column containing numeric values.

Source:

In the following sample, input values are in degrees:

X

-30

0

30

45

60

90

120

135

180

Transformation:

In this example, all values are rounded to three decimals for clarity.

First, the above values in degrees must be converted to radians.

Transformation Name

New formula

Parameter: Formula type

Single row formula

Parameter: Formula

round(radians(X), 3)

Parameter: New column name

'rX'

Sine:

Transformation Name

New formula

Parameter: Formula type

Single row formula

Parameter: Formula

round(sin(rX), 3)

Parameter: New column name

'SINrX'

Cosine:

Transformation Name

New formula

Parameter: Formula type

Single row formula

Parameter: Formula

round(cos(rX), 3)

Parameter: New column name

'COSrX'

Tangent:

Transformation Name

New formula

Parameter: Formula type

Single row formula

Parameter: Formula

round(tan(rX), 3)

Parameter: New column name

'TANrX'

Cotangent:

Transformation Name

New formula

Parameter: Formula type

Single row formula

Parameter: Formula

round(1 / tan(rX), 3)

Parameter: New column name

'COTrX'

Secant:

Transformation Name

New formula

Parameter: Formula type

Single row formula

Parameter: Formula

round(1 / cos(rX), 3)

Parameter: New column name

'SECrX'

Cosecant:

Transformation Name

New formula

Parameter: Formula type

Single row formula

Parameter: Formula

round(1 / sin(rX), 3)

Parameter: New column name

'CSCrX'

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