summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/helpids.h4
-rw-r--r--sc/source/core/inc/interpre.hxx4
-rw-r--r--sc/source/core/tool/interpr1.cxx24
-rw-r--r--sc/source/core/tool/interpr4.cxx4
-rw-r--r--sc/source/ui/src/scfuncs.src99
-rw-r--r--sc/util/hidother.src4
6 files changed, 139 insertions, 0 deletions
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index ec756ae59b26..5eec0d1c3301 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -518,6 +518,10 @@
#define HID_FUNC_COTHYP "SC_HID_FUNC_COTHYP"
#define HID_FUNC_TANHYP "SC_HID_FUNC_TANHYP"
#define HID_FUNC_ARCTAN2 "SC_HID_FUNC_ARCTAN2"
+#define HID_FUNC_COSECANT "SC_HID_FUNC_COSECANT"
+#define HID_FUNC_SECANT "SC_HID_FUNC_SECANT"
+#define HID_FUNC_SECANTHYP "SC_HID_FUNC_SECANTHYP"
+#define HID_FUNC_COSECANTHYP "SC_HID_FUNC_COSECANTHYP"
#define HID_FUNC_DEG "SC_HID_FUNC_DEG"
#define HID_FUNC_RAD "SC_HID_FUNC_RAD"
#define HID_FUNC_EXP "SC_HID_FUNC_EXP"
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index d35b53d6afe1..111f74ffb8a5 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -412,6 +412,10 @@ void ScArcSinHyp();
void ScArcCosHyp();
void ScArcTanHyp();
void ScArcCotHyp();
+void ScCosecant();
+void ScSecant();
+void ScCosecantHyp();
+void ScSecantHyp();
void ScExp();
void ScLn();
void ScLog10();
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 71151d22707c..56719f40c0a5 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1748,6 +1748,30 @@ void ScInterpreter::ScArcCotHyp()
PushDouble(0.5 * log((nVal + 1.0) / (nVal - 1.0)));
}
+void ScInterpreter::ScCosecant()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "regina", "ScInterpreter::ScCosecant" );
+ PushDouble(1.0 / ::rtl::math::sin(GetDouble()));
+}
+
+void ScInterpreter::ScSecant()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "regina", "ScInterpreter::ScSecant" );
+ PushDouble(1.0 / ::rtl::math::cos(GetDouble()));
+}
+
+void ScInterpreter::ScCosecantHyp()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "regina", "ScInterpreter::ScCosecantHyp" );
+ PushDouble(1.0 / sinh(GetDouble()));
+}
+
+void ScInterpreter::ScSecantHyp()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "regina", "ScInterpreter::ScSecantHyp" );
+ PushDouble(1.0 / cosh(GetDouble()));
+}
+
void ScInterpreter::ScExp()
{
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 1ff85ba6125b..d134d744b46b 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3812,6 +3812,10 @@ StackVar ScInterpreter::Interpret()
case ocArcCosHyp : ScArcCosHyp(); break;
case ocArcTanHyp : ScArcTanHyp(); break;
case ocArcCotHyp : ScArcCotHyp(); break;
+ case ocCosecant : ScCosecant(); break;
+ case ocSecant : ScSecant(); break;
+ case ocCosecantHyp : ScCosecantHyp(); break;
+ case ocSecantHyp : ScSecantHyp(); break;
case ocExp : ScExp(); break;
case ocLn : ScLn(); break;
case ocLog10 : ScLog10(); break;
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 8f8bb04e5be1..44584090e7e2 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -3468,6 +3468,105 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
Text [ en-US ] = "The value for the y coordinate." ;
};
};
+
+ // -=*# Resource for function CSC #*=-
+ Resource SC_OPCODE_COSECANT
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Return the cosecant of an angle. CSC(x)=1/SIN(x)" ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_MATH;
+ U2S( HID_FUNC_COSECANT );
+ 1; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "Angle" ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "The angle in radians for which the cosecant is to be calculated." ;
+ };
+ };
+
+ // -=*# Resource for function SEC #*=-
+ Resource SC_OPCODE_SECANT
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Return the secant of an angle. SEC(x)=1/COS(x)" ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_MATH;
+ U2S( HID_FUNC_SECANT );
+ 1; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "Angle" ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "The angle in radians for which the secant is to be calculated." ;
+ };
+ };
+ // -=*# Resource for function CSCH #*=-
+ Resource SC_OPCODE_COSECANT_HYP
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Return the hyperbolic cosecant of a hyperbolic angle. CSCH(x)=1/SINH(x)" ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_MATH;
+ U2S( HID_FUNC_COSECANTHYP );
+ 1; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "Angle" ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "The hyperbolic angle in radians for which the hyperbolic cosecant is to be calculated." ;
+ };
+ };
+ // -=*# Resource for function SECH #*=-
+ Resource SC_OPCODE_SECANT_HYP
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Return the hyperbolic secant of a hyperbolic angle. SECH(x)=1/COSH(x)" ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_MATH;
+ U2S( HID_FUNC_SECANTHYP );
+ 1; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "Angle" ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "The hyperbolic angle in radians for which the hyperbolic secant is to be calculated." ;
+ };
+ };
+
// -=*# Resource for function DEG #*=-
Resource SC_OPCODE_DEG
{
diff --git a/sc/util/hidother.src b/sc/util/hidother.src
index b45e5fa5898d..363e08c9b56d 100644
--- a/sc/util/hidother.src
+++ b/sc/util/hidother.src
@@ -191,6 +191,10 @@ hidspecial HID_FUNC_SINHYP { HelpID = HID_FUNC_SINHYP; };
hidspecial HID_FUNC_COTHYP { HelpID = HID_FUNC_COTHYP; };
hidspecial HID_FUNC_TANHYP { HelpID = HID_FUNC_TANHYP; };
hidspecial HID_FUNC_ARCTAN2 { HelpID = HID_FUNC_ARCTAN2; };
+hidspecial HID_FUNC_COSECANT { HelpID = HID_FUNC_COSECANT; };
+hidspecial HID_FUNC_SECANT { HelpID = HID_FUNC_SECANT; };
+hidspecial HID_FUNC_COSECANTHYP { HelpID = HID_FUNC_COSECANTHYP; };
+hidspecial HID_FUNC_SECANTHYP { HelpID = HID_FUNC_SECANTHYP; };
hidspecial HID_FUNC_DEG { HelpID = HID_FUNC_DEG; };
hidspecial HID_FUNC_RAD { HelpID = HID_FUNC_RAD; };
hidspecial HID_FUNC_EXP { HelpID = HID_FUNC_EXP; };