home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>Sin-Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03080103"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> p.P1{ } span.T1{ font-weight:bold;} </style></head><body> <help:to-be-embedded Eid="sin" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:link Id="66493">Sin-Function [Runtime]</help:link></p> <p class="Paragraph">Returns the sine of an angle. The angle is specified in radians. The result lies between -1 and 1.</p> </help:to-be-embedded> <p class="Paragraph">Using the angle Alpha, the Sin Function returns the ratio of the length of the opposite side of an angle to the length of the hypotenuse in a right-angled triangle.</p> <p class="Paragraph">Sin(Alpha) = side opposite the angle/hypotenuse</p> <p class="Paragraph"><span class="T1">Syntax</span>:</p> <p class="Paragraph">Sin (Number) <help:key-word value="Sin" tag="kw66493_1" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><span class="T1">Return value</span>:</p> <p class="Paragraph">Double</p> <p class="Paragraph"><span class="T1">Parameter</span>:</p> <p class="Paragraph">Number: Numeric expression that defines the angle in radians, for which to calculate the sine.</p> <p class="Paragraph">To convert degrees to radians, multiply degrees by Pi/180, and to convert radians to degrees, multiply radians by 180/Pi.</p> <p class="Paragraph">grad=(radiant*180)/pi</p> <p class="Paragraph">radiant=(grad*pi)/180</p> <p class="Paragraph">Pi is approximately 3.141593.</p> <p class="Paragraph"><span class="T1">Example:</span></p> <p class="PropText">REM In this example, the following entry is possible for a right-angled triangle:</p> <p class="PropText">REM The side opposite the angle and the angle (in degrees) to calculate the length of the hypotenuse:</p> <p class="PropText">Sub ExampleSine</p> <p class="PropText">REM Pi = 3.1415926 is a predefined variable</p> <p class="PropText">Dim d1 as Double</p> <p class="PropText">Dim dAlpha as Double</p> <p class="PropText">d1 = InputBox$ ("Enter the length of the opposite side: ","Opposite Side")</p> <p class="PropText">dAlpha = InputBox$ "Enter the angle Alpha (in degrees): ","Alpha")</p> <p class="PropText">Print "The length of the hypotenuse is"; (d1 / sin (dAlpha * Pi / 180))</p> <p class="PropText">End Sub</p> <p class="PropText"/> </body></html>