mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
improve comments for versed sine and coversed sine functions
This commit is contained in:
18
comfunc.c
18
comfunc.c
@@ -1328,11 +1328,18 @@ c_ilog(COMPLEX *c, ZVALUE base)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate the complex versed sine within the specified accuracy.
|
* c_versin - versed sine for COMPLEX values
|
||||||
*
|
*
|
||||||
* This uses the formula:
|
* This uses the formula:
|
||||||
*
|
*
|
||||||
* versin(x) = 1 - cos(x)
|
* versin(x) = 1 - cos(x)
|
||||||
|
*
|
||||||
|
* given:
|
||||||
|
* q complex value to pass to the trig function
|
||||||
|
* epsilon error tolerance / precision for trig calculation
|
||||||
|
*
|
||||||
|
* returns:
|
||||||
|
* complex value result of trig function on q with error epsilon
|
||||||
*/
|
*/
|
||||||
COMPLEX *
|
COMPLEX *
|
||||||
c_versin(COMPLEX *c, NUMBER *epsilon)
|
c_versin(COMPLEX *c, NUMBER *epsilon)
|
||||||
@@ -1367,11 +1374,18 @@ c_versin(COMPLEX *c, NUMBER *epsilon)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate the complex versed cosine within the specified accuracy.
|
* c_coversin - coversed sine for COMPLEX values
|
||||||
*
|
*
|
||||||
* This uses the formula:
|
* This uses the formula:
|
||||||
*
|
*
|
||||||
* coversin(x) = 1 - sin(x)
|
* coversin(x) = 1 - sin(x)
|
||||||
|
*
|
||||||
|
* given:
|
||||||
|
* q complex value to pass to the trig function
|
||||||
|
* epsilon error tolerance / precision for trig calculation
|
||||||
|
*
|
||||||
|
* returns:
|
||||||
|
* complex value result of trig function on q with error epsilon
|
||||||
*/
|
*/
|
||||||
COMPLEX *
|
COMPLEX *
|
||||||
c_coversin(COMPLEX *c, NUMBER *epsilon)
|
c_coversin(COMPLEX *c, NUMBER *epsilon)
|
||||||
|
6
func.c
6
func.c
@@ -10614,6 +10614,9 @@ f_version(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* f_versin - versed sine
|
||||||
|
*/
|
||||||
S_FUNC VALUE
|
S_FUNC VALUE
|
||||||
f_versin(int count, VALUE **vals)
|
f_versin(int count, VALUE **vals)
|
||||||
{
|
{
|
||||||
@@ -10665,6 +10668,9 @@ f_versin(int count, VALUE **vals)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* f_coversin - coversed sine
|
||||||
|
*/
|
||||||
S_FUNC VALUE
|
S_FUNC VALUE
|
||||||
f_coversin(int count, VALUE **vals)
|
f_coversin(int count, VALUE **vals)
|
||||||
{
|
{
|
||||||
|
22
qtrans.c
22
qtrans.c
@@ -1975,11 +1975,20 @@ qacoth(NUMBER *q, NUMBER *epsilon)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* versed sine - this calls qsincos() and discards the value of sin.
|
* qversin - versed sine for NUMBER values
|
||||||
*
|
*
|
||||||
* This uses the formula:
|
* This uses the formula:
|
||||||
*
|
*
|
||||||
* versin(x) = 1 - cos(x)
|
* versin(x) = 1 - cos(x)
|
||||||
|
*
|
||||||
|
* This calls qsincos() and discards the value of sin.
|
||||||
|
*
|
||||||
|
* given:
|
||||||
|
* q real value to pass to the trig function
|
||||||
|
* epsilon error tolerance / precision for trig calculation
|
||||||
|
*
|
||||||
|
* returns:
|
||||||
|
* real value result of trig function on q with error epsilon
|
||||||
*/
|
*/
|
||||||
NUMBER *
|
NUMBER *
|
||||||
qversin(NUMBER *q, NUMBER *epsilon)
|
qversin(NUMBER *q, NUMBER *epsilon)
|
||||||
@@ -2006,11 +2015,20 @@ qversin(NUMBER *q, NUMBER *epsilon)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* versed cosine - this calls qsincos() and discards the value of cos.
|
* qversin - coversed sine for NUMBER values
|
||||||
*
|
*
|
||||||
* This uses the formula:
|
* This uses the formula:
|
||||||
*
|
*
|
||||||
* coversin(x) = 1 - sin(x)
|
* coversin(x) = 1 - sin(x)
|
||||||
|
*
|
||||||
|
* This calls qsincos() and discards the value of cos.
|
||||||
|
*
|
||||||
|
* given:
|
||||||
|
* q real value to pass to the trig function
|
||||||
|
* epsilon error tolerance / precision for trig calculation
|
||||||
|
*
|
||||||
|
* returns:
|
||||||
|
* real value result of trig function on q with error epsilon
|
||||||
*/
|
*/
|
||||||
NUMBER *
|
NUMBER *
|
||||||
qcoversin(NUMBER *q, NUMBER *epsilon)
|
qcoversin(NUMBER *q, NUMBER *epsilon)
|
||||||
|
Reference in New Issue
Block a user