## Sin Function

This standard VB function returns the sine of an angle specified in radians.

##### Syntax

Sin(number)

Argument
Description

number

A numeric expression containing a number representing the size of an angle in radians

##### Returns

The sine of number.

##### Usage

The return value is between -1 and 1. The return value is single precision if the angle is an integer, currency, or single-precision value; double precision for a long, variant, or double-precision value. The angle is specified in radians and can be either positive or negative.

To convert degrees to radians, multiply by (PI/180). The value of PI is 3.14159.

##### Example

This 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