Files
calc/help/vercos
Landon Curt Noll b0a48a2b70 add new versin and vercos builtin functions
Added new versin(x, [,eps]) for versed sine and vercos(x, [,eps])
for versed cosine.

Updated trig help files.
2023-09-01 17:38:14 -07:00

68 lines
2.1 KiB
Plaintext

NAME
vercos - versed cosine
SYNOPSIS
vercos(x [,eps])
TYPES
x number (real or complex)
eps 0 < real < 1, defaults to epsilon()
return number
DESCRIPTION
Calculate the versed cosine of x to a multiple of eps with error less in
absolute value than .75 * eps.
The versed cosine function is sometimes called coversin, sometimes called cvs,
may be defined as:
vercos(x) = 1 - sin(x)
EXAMPLE
; print vercos(0.2), vercos(3/7), vercos(-31)
0.80133066920493878454 0.58442814500694799193 0.59596235467693499395
; print vercos(1, 1e-5), vercos(1, 1e-10), vercos(1, 1e-15), vercos(1, 1e-20)
0.15853 0.1585290152 0.158529015192104 0.15852901519210349335
; print vercos(2 + 3i, 1e-5), vercos(2 + 3i, 1e-10)
-8.1545+4.16891i -8.1544991469+4.16890696i
; pi = pi(1e-20)
; print vercos(pi/6, 1e-10), vercos(pi/2, 1e-10), vercos(pi, 1e-10), vercos(3*pi/2, 1e-10)
0.5 0 1 2
LIMITS
0 < eps < 1
LINK LIBRARY
NUMBER *qvercos(NUMBER *x, NUMBER *eps)
COMPLEX *c_vercos(COMPLEX *x, NUMBER *eps)
SEE ALSO
sin, cos, tan, sec, csc, cot, epsilon
versin
## Copyright (C) 2023 Landon Curt Noll
##
## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License
## as published by the Free Software Foundation.
##
## Calc is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
## Public License for more details.
##
## A copy of version 2.1 of the GNU Lesser General Public License is
## distributed with calc under the filename COPYING-LGPL. You should have
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
##
## Under source code control: 2023/08/31 23:07:08
## File existed as early as: 2023
##
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/