From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03080102.xhp | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03080102.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03080102.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03080102.xhp b/helpcontent2/source/text/sbasic/shared/03080102.xhp new file mode 100644 index 000000000..908daeec3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03080102.xhp @@ -0,0 +1,74 @@ + + + + + + + Cos Function + /text/sbasic/shared/03080102.xhp + + + + + + +
+ + Cos function + + + +Cos Function +Calculates the cosine of an angle. The angle is specified in radians. The result lies between -1 and 1. +
+Using the angle Alpha, the Cos-Function calculates the ratio of the length of the side that is adjacent to the angle, divided by the length of the hypotenuse in a right-angled triangle. +Cos(Alpha) = Adjacent/Hypotenuse + +Syntax: + +Cos (Number) + + +Return value: +Double + +Parameters: + Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for. +To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi. +degree=(radian*180)/pi +radian=(degree*pi)/180 +Pi is here the fixed circle constant with the rounded value 3.14159... + + + +Example: + +' The following example allows for a right-angled triangle the input of +' secant and angle (in degrees) and calculates the length of the hypotenuse: +Sub ExampleCosinus +' rounded Pi = 3.14159 +Dim d1 As Double, dAngle As Double + d1 = InputBox("Enter the length of the adjacent side: ","Adjacent") + dAngle = InputBox("Enter the angle Alpha (in degrees): ","Alpha") + Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180)) +End Sub + + + +
\ No newline at end of file -- cgit v1.2.3