/usr/include/ComTerp/mathfunc.h is in ivtools-dev 1.2.11a1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | /*
* Copyright (c) 2000 IET Inc.
* Copyright (c) 1998,1999 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of the copyright holders not be used in
* advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. The copyright holders make
* no representations about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* This is a collection of mathematical operators.
*/
#if !defined(_mathfunc_h)
#define _mathfunc_h
#include <ComTerp/comfunc.h>
//: exponential command for ComTerp.
// dbl=exp(x) -- returns the value e raised to the power of x.
class ExpFunc : public ComFunc {
public:
ExpFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the value e raised to the power of x"; }
};
//: logarithmic (natural) command for ComTerp.
// dbl=log(x) -- returns the natural logarithm of x.
class LogFunc : public ComFunc {
public:
LogFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the natural logarithm of x"; }
};
//: logarithmic (base 10) command for ComTerp.
// dbl=log10(x) -- returns the base-10 logarithm of x.
class Log10Func : public ComFunc {
public:
Log10Func(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the base-10 logarithm of x"; }
};
//: power command for ComTerp.
// dbl=pow(x y) -- returns the value of x raised to the power of y.
class PowFunc : public ComFunc {
public:
PowFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x y) -- returns the value of x raised to the power of y"; }
};
//: arc-cosine command for ComTerp.
// dbl=acos(x) -- returns the arc cosine of x in radians.
class ACosFunc : public ComFunc {
public:
ACosFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the arc cosine of x in radians"; }
};
//: arc-sine command for ComTerp.
// dbl=asin(x) -- returns the arc sine of x in radians.
class ASinFunc : public ComFunc {
public:
ASinFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the arc sine of x in radians"; }
};
//: arc-tangent command for ComTerp.
// dbl=atan(x) -- returns the arc tangent of x in radians.
class ATanFunc : public ComFunc {
public:
ATanFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the arc tangent of x in radians"; }
};
//: arc-tangent (of y over x) command for ComTerp.
// dbl=atan2(y x) -- returns the arc tangent of y over x.
class ATan2Func : public ComFunc {
public:
ATan2Func(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(y x) -- returns the arc tangent of y over x"; }
};
//: cosine command for ComTerp.
// dbl=cos(x) -- returns the cosine of x radians.
class CosFunc : public ComFunc {
public:
CosFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the cosine of x radians"; }
};
//: sine command for ComTerp.
// dbl=sin(x) -- returns the sine of x radians.
class SinFunc : public ComFunc {
public:
SinFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the sine of x radians"; }
};
//: tangent command for ComTerp.
// dbl=tan(x) -- returns the tangent of x radians.
class TanFunc : public ComFunc {
public:
TanFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns the tangent of x radians"; }
};
//: square-root command for ComTerp.
// dbl=sqrt(x) -- returns square root of x.
class SqrtFunc : public ComFunc {
public:
SqrtFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- returns square root of x"; }
};
//: Pi command for ComTerp.
// dbl=pi() -- returns the value of pi.
class PiFunc : public ComFunc {
public:
PiFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s() -- returns the value of pi"; }
};
//: radians to degrees command for ComTerp.
// dbl=radtodeg(dbl) -- convert radians to degrees
class RadToDegFunc : public ComFunc {
public:
RadToDegFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- convert radians to degrees"; }
};
//: degrees to radianscommand for ComTerp.
// dbl=degtorad(dbl) -- convert degrees to radians
class DegToRadFunc : public ComFunc {
public:
DegToRadFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
return "dbl=%s(x) -- convert radians to degrees"; }
};
#endif /* !defined(_mathfunc_h) */
|