Tan() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns the tangent of a number. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Tan( num_expr ) 

num_expr is a numeric expression representing an angle in radians.

Return Value

Float

Description

The Tan() function returns the tangent of the numeric num_expr value, which represents an angle in radians.

To convert a degree value to radians, multiply that value by DEG_2_RAD (0.01745329252). To convert a radian value into degrees, multiply that value by RAD_2_DEG (57.29577951). (Note that your program will need to Include "MAPBASIC.DEF" in order to reference DEG_2_RAD or RAD_2_DEG).

Example

Include "mapbasic.def"

Dim x, y As Float 

x = 45 * DEG_2_RAD 
y = Tan(x)  

y will now be equal to 1, because the tangent of 45 degrees is 1.

See Also:

Acos() function, Asin() function, Atn() function, Cos() function, Sin() function