Math.Cos Method

Returns the cosine of a specified angle.

...Math.Cos(angle )

Prerequisites

None

Parameters

angle

A required expression that evaluates to an angle in units of radians. This angle is not limited to values between -π and +π and can be arbitrarily large.

Remarks

Returns the cosine of the angle that is specified in radians. The result of this method ranges from –1 to +1.

To convert degrees to radians, multiply the degrees times π/180.

Examples

Dim cos_val As Single
cos_val = Math.Cos(0) ' Sets cos_val to 1
cos_val = Math.Cos(21*Math.PI) ' Sets cos_val to -1
cos_val = Math.Cos(45*Math.PI/180) ' Sets cos_val to 0.7071

See Also

Math Class