Get Sine Method
The Get Sine method returns the sine of an angle specified in radians. The return value is between -1 and 1. You specify the angle in radians as a positive or negative number. To convert degrees to radians, this method multiplies degrees by (PI/180). The value of PI is 3.14159.
For information on how this method handles the data type, see How Some Math Methods Handle the Data Type.
Format
Sin(number)
The following table describes the arguments that you can use with this method.
Argument | Description |
---|---|
number |
A numeric expression that contains a number that represents the size of an angle in radians. |
Example
The following example finds the height of a building, given the length of the roof and the roof pitch:
Sub Button_Click
Dim height, rooflength, pitch, msgtext As String
Const PI = 3.14159
Const conversion = PI/180
pitch = 35
pitch = pitch * conversion
rooflength = 75
height = Sin(pitch) * rooflength
msgtext = "The height of the building is "
msgtext = msgtext & Format(height, "##.##") & " feet."
End Sub