Name

Tan Function

Syntax

Tan (number)
number

Use: Required

Data Subtype: Numeric expression

An angle in radians.

Return Value

A Variant of subtype Double containing the tangent of an angle.

Description

Returns the ratio of two sides of a right-angle triangle.

Rules at a Glance

The returned ratio is derived by dividing the length of the side opposite the angle by the length of the side adjacent to the angle.

Programming Tips & Gotchas

  • You can convert degrees to radians using the following formula:

    radians = degrees * (pi/180)
  • You can convert radians to degrees using the following formula:

    degrees = radians * (180/pi)

Get VBScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.