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 type:

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 ការ​ហៅ​បែបបទ​មិន​ត្រឹមត្រូវ

Example:


REM In this example, the following entry is possible for a right-angled triangle:
REM ផ្នែក​ដែល​នៅ​ទល់​មុខ​នឹង​មុំ និង​មុំ​ (គិត​ជា​ដឺក្រេ)​ ដើម្បី​គណនា​ប្រវែង​របស់​ផ្នែក​ដែល​នៅ​ជាប់​នឹង​មុំ ៖
Sub ExampleTangens
REM Pi = 3.1415926 is a pre-defined variable
Dim d1 As Double
Dim dAlpha As Double
    d1 = InputBox("Enter the length of the side opposite the angle: ","opposite")
    dAlpha = 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