Tan Function

āĻāĻ•āĻŸāĻŋ āĻ•ā§‹āĻ¨ā§‡āĻ° āĻŸā§‡āĻ¨āĻœā§‡āĻ¨ā§āĻŸ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻ•āĻ°āĻž āĻšā§ŸāĨ¤ āĻ•ā§‹āĻ¨āĻŸāĻŋ āĻ°ā§‡āĻĄāĻŋā§ŸāĻžāĻ¨ā§‡ āĻ‰āĻ˛ā§āĻ˛ā§‡āĻ– āĻ•āĻ°āĻž āĻšā§ŸāĨ¤

Using the angle Alpha, the Tan function calculates the ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in a right-angled triangle.

Tan(Alpha) = side opposite the angle/side adjacent to angle

Syntax:


Tan (Number As Double) As Double

Return value:

Double

Parameters:

āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž: āĻ¯ā§‡āĻ•ā§‹āĻ¨ā§‹ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻžāĻ¸ā§‚āĻšāĻ• āĻāĻ•ā§āĻ¸āĻĒā§āĻ°ā§‡āĻļāĻ¨ āĻ¯āĻžāĻ° āĻŸā§‡āĻ¨āĻœā§‡āĻ¨ā§āĻŸ āĻ—āĻŖāĻ¨āĻž āĻ•āĻ°āĻ¤ā§‡ āĻšāĻžāĻ¨ (āĻ°ā§‡āĻĄāĻŋā§ŸāĻžāĻ¨ā§‡)āĨ¤

To convert degrees to radians, multiply by Pi/180. To convert radians to degrees, multiply by 180/Pi.

degrees=(radians*180)/Pi

radians=(degrees*Pi)/180

Pi is approximately 3.141593.

Error codes:

5 Invalid procedure call

Example:


REM āĻāĻ‡ āĻ‰āĻĻāĻžāĻšāĻ°āĻŖā§‡, āĻ¨āĻŋāĻšā§‡āĻ° āĻāĻ¨ā§āĻŸā§āĻ°āĻŋāĻŸāĻŋ āĻ¸āĻŽāĻ•ā§‹āĻ¨ā§€ āĻ¤ā§āĻ°āĻŋāĻ­ā§āĻœā§‡āĻ° āĻœāĻ¨ā§āĻ¯ āĻ¸āĻŽā§āĻ­āĻžāĻŦā§āĻ¯:
REM āĻ•ā§‹āĻ¨ā§‡āĻ° āĻŦāĻŋāĻĒāĻ°ā§€āĻ¤ āĻŦāĻžāĻšā§ āĻāĻŦāĻ‚ āĻ•ā§‹āĻ¨ āĻ¸āĻ‚āĻļā§āĻ˛āĻŋāĻˇā§āĻŸ āĻŦāĻžāĻšā§āĻ° āĻĻā§ˆāĻ°ā§āĻ˜ā§āĻ¯ āĻ—āĻŖāĻ¨āĻž āĻ•āĻ°āĻžāĻ° āĻœāĻ¨ā§āĻ¯ āĻ•ā§‹āĻ¨ (āĻĄāĻŋāĻ—ā§āĻ°āĻŋāĻ¤ā§‡):
Sub ExampleTangens
REM Pi = 3.1415926 āĻĒā§‚āĻ°ā§āĻŦāĻŋāĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŋāĻ¤ āĻ­ā§‡āĻ°āĻŋā§Ÿā§‡āĻŦāĻ˛
Dim d1 As Double
Dim dAlpha As Double
    d1 = InputBox("Enter the length of the side opposite the angle: ","opposite")
    ddAlpha = InputBox("Enter the Alpha angle (in degrees): ","Alpha")
    Print "the length of the side adjacent the angle is"; (d1 / tan (dAlpha * Pi / 180))
End Sub

Please support us!