Sin Function

See AlsoC8AIPK              ExampleGUA1BM>Low

Returns the sine of an angle.

Syntax

Sin(angle)

Remarks

The argument angle can be any valid numeric expression71RISN measured in radians.

The Sin function takes an angle and returns the ratio of two sides of a right triangle. The ratio is the length of the side opposite the angle divided by the length of the hypotenuse.

The result lies in the range -1 to 1.

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


See Also

Atn FunctionLANATN

Cos FunctionLANCOS

Tan FunctionLANTAN

Math FunctionsEK0VY1

Derived Math Functions3KO5YS8


Sin Function Example

The example uses Sin to calculate the sine of an angle with a user-specified number of degrees.  To try this example, paste the code into the Declarations section of a form.  Then press F5 and click the form.

 

Sub Form_Click ()

   Dim Degrees, Msg, Pi, Radians               ' Declare variables.

   Pi = 4 * Atn(1)                             ' Calculate Pi.

   Degrees = InputBox("Enter an angle in degrees.")  ' Get user input.

   Radians = Degrees * (Pi / 180)              ' Convert to radians.

   Msg = "The sine of a " & Degrees

   Msg = Msg & " degree angle is "

   Msg = Msg & Sin(Radians) & "."

   MsgBox Msg                                  ' Display results.

End Sub