IBM Lotus Symphony
|
计算一个角度的正切值。角度以弧度指定。
以 Alpha 角为例,在直角三角形中 Tan 函数计算的是 Alpha 的对边与邻边长度之比。
Tan(Alpha) = 对边/邻边
Tan (Number)
双倍行距
Number:要计算正切值的任何数字表达式,以弧度为单位。
要将度转换为弧度,可将度乘以 pi/180。而要将弧度转换为度,请将弧度乘以 180/pi。
度 =(弧度*180)/Pi
弧度 =(度*Pi)/180
Pi 的近似值是 3.141593。
REM In this example, the following entry is possible for a right-angled triangle:
REM The side opposite the angle and the angle (in degrees) to calculate the length of the side adjacent to the angle:
Sub ExampleTangens
REM Pi = 3.1415926 is a pre-defined variable
Dim d1 as Double
Dim d1 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