Module: BigMathR::Trig
- Defined in:
- ext/bigdecimal/math_r/trig.c,
ext/bigdecimal/math_r/math_r.c
Overview
A module that provide the trigonometric functions. It is used internally.
All module functions are implemented by :sincos.
Synopsis
The function names defined are the same as those in the C/C++ standard.
-
Sine:
:sin -
Cosine:
:cos -
Tangent:
:tan
Follow, those reciprocals of not defined in C/C++ standard.
-
Cosecant:
:csc -
Secant:
:sec -
Cotangent:
:cot
The following are GNU extensions:
-
sincos():
:sincos
- Reference
-
Kiso kara hatten made Sankaku kansuu (Japanese) - Michimasa Kobayashi (Beret Shuppan)
Class Method Summary collapse
-
.cos(x, prec) ⇒ BigDecimal
Computes cosine of
x. -
.cot(x, prec) ⇒ BigDecimal
Computes cotangent of
x. -
.csc(x, prec) ⇒ BigDecimal
Computes cosecant of
x. -
.sec(x, prec) ⇒ BigDecimal
Computes secant of
x. -
.sin(x, prec) ⇒ BigDecimal
Computes sine of
x. -
.tan(x, prec) ⇒ BigDecimal
Computes tangent of
x.
Class Method Details
.cos(x, prec) ⇒ BigDecimal
Computes cosine of x.
x gives in radian.
78 79 80 81 82 |
# File 'ext/bigdecimal/math_r/trig.c', line 78
static VALUE
__impl_trig_cos(VALUE unused_obj, VALUE x, VALUE prec)
{
return cos_branch(x, prec, cos_ser);
}
|
.cot(x, prec) ⇒ BigDecimal
Computes cotangent of x.
x gives in radian.
164 165 166 167 168 |
# File 'ext/bigdecimal/math_r/trig.c', line 164
static VALUE
__impl_trig_cot(VALUE unused_obj, VALUE x, VALUE prec)
{
return cot_branch(x, prec, cot_ser);
}
|
.csc(x, prec) ⇒ BigDecimal
Computes cosecant of x.
x gives in radian.
121 122 123 124 125 |
# File 'ext/bigdecimal/math_r/trig.c', line 121
static VALUE
__impl_trig_csc(VALUE unused_obj, VALUE x, VALUE prec)
{
return csc_branch(x, prec, csc_ser);
}
|
.sec(x, prec) ⇒ BigDecimal
Computes secant of x.
x gives in radian.
142 143 144 145 146 |
# File 'ext/bigdecimal/math_r/trig.c', line 142
static VALUE
__impl_trig_sec(VALUE unused_obj, VALUE x, VALUE prec)
{
return sec_branch(x, prec, sec_ser);
}
|
.sin(x, prec) ⇒ BigDecimal
Computes sine of x.
x gives in radian.
56 57 58 59 60 |
# File 'ext/bigdecimal/math_r/trig.c', line 56
static VALUE
__impl_trig_sin(VALUE unused_obj, VALUE x, VALUE prec)
{
return sin_branch(x, prec, sin_ser);
}
|
.tan(x, prec) ⇒ BigDecimal
Computes tangent of x.
x gives in radian.
100 101 102 103 104 |
# File 'ext/bigdecimal/math_r/trig.c', line 100
static VALUE
__impl_trig_tan(VALUE unused_obj, VALUE x, VALUE prec)
{
return tan_branch(x, prec, tan_ser);
}
|