Cos Function

Tips >>ASP Functions


WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The Cos function returns the cosine of a specified number (angle). Its parameter is number, which describes a numeric expression that expresses an angle in radians. The number argument can be any valid numeric expression that expresses an angle in radians. The Cos function takes an angle and returns the ratio of two sides of a right triangle. The ratio is the length of the side adjacent to 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.


The following example uses the Cos function to return the cosine of an angle :-

Dim MyAngle, MySecantMyAngle = 1.3 ' Define angle in radians.MySecant = 1 / Cos (MyAngle) ' Calculate secant.

The Syntax of the Cos function is :-

Cos(number)

Example#1 :-

Code :-
document.write(Cos(50.0))
Output :-
0.964966028492113

Example#2 :-

Code :-
document.write(Cos(-50.0))
Output :-
0.964966028492113

Example#3 :-

Code :-
<% =Cos(45.0) %>
Output :-

0.52532198881773

Note :- You can also use a negative number (angle).

Example#4 :-

Code :-
<% =Cos(-45.0) %>
Output :-

0.52532198881773

Example#5:-

Before: Code: After:
0 Cos("0") 0
60 Cos("60") 0.5
90 Cos("90") 1

 

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

+91-9967648641

+91-9967648641