* hyperbolic funtions in MP
@ 2003-05-17 13:09 Peter Rolf
2003-05-17 15:17 ` Hans Hagen
2003-05-17 17:53 ` Jens-Uwe Morawski
0 siblings, 2 replies; 3+ messages in thread
From: Peter Rolf @ 2003-05-17 13:09 UTC (permalink / raw)
I have problems using the hyperbolic functions sinh and cosh (MetaFun manual
page 204) in metapost. A simple call of sinh (with valid parameter)
ct:= sinh(3) ;
gives
----------------------------------------
This is pdfeTeX, Version 3.141592-1.10b-2.1 (MiKTeX 2.3)
ConTeXt ver: 2003.4.29 fmt: 2003.5.8 int: english mes: english
...
>> xx-2
! Unknown relation will be considered false.
<to be read again>
:
**->if(EXPR1)=2:
(EXPR0)*(EXPR0)else:takepower(EXPR1)of(EXPR0)fi
<to be read again>
)
exp->begingroup((mexp256)**(EXPR2))
endgroup
<to be read again>
;
sinh->begingroup.save.xx;xx=exp.xx;
(xx-1/xx)/2endgroup
<to be read again>
;
l.152 ct:= sinh(3) ;
?
----------------------------------------
Same error for cosh. The functions sin, cos and asinh, acosh work.
Please, could somebody test, if this is a general problem...
Greetings,
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: hyperbolic funtions in MP
2003-05-17 13:09 hyperbolic funtions in MP Peter Rolf
@ 2003-05-17 15:17 ` Hans Hagen
2003-05-17 17:53 ` Jens-Uwe Morawski
1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2003-05-17 15:17 UTC (permalink / raw)
At 15:09 17/05/2003 +0200, you wrote:
>I have problems using the hyperbolic functions sinh and cosh (MetaFun manual
>page 204) in metapost. A simple call of sinh (with valid parameter)
>
> ct:= sinh(3) ;
in mp-tool.mp, change:
vardef sinh primary x = save xx ; xx = exp x ; (xx-1/xx)/2 enddef ;
vardef cosh primary x = save xx ; xx = exp x ; (xx+1/xx)/2 enddef ;
^^^
(you need to run "texexec --make metafun")
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: hyperbolic funtions in MP
2003-05-17 13:09 hyperbolic funtions in MP Peter Rolf
2003-05-17 15:17 ` Hans Hagen
@ 2003-05-17 17:53 ` Jens-Uwe Morawski
1 sibling, 0 replies; 3+ messages in thread
From: Jens-Uwe Morawski @ 2003-05-17 17:53 UTC (permalink / raw)
On Sat, 17 May 2003 15:09:09 +0200
Peter Rolf <peter.rolf@arcor.de> wrote:
> I have problems using the hyperbolic functions sinh and cosh (MetaFun manual
> page 204) in metapost. A simple call of sinh (with valid parameter)
>
> ct:= sinh(3) ;
>
the following definition in mp-tool.mp
vardef sinh primary x = save xx ; xx = exp xx ; (xx-1/xx)/2 enddef
should be
vardef sinh primary x = save xx ; xx = exp x ; (xx-1/xx)/2 enddef
until Hans has fixed the problem you may use
\startMPinclusions
vardef sinh primary x = ((exp x) - ( exp (-x)))/2 enddef ;
vardef cosh primary x = ((exp x) + ( exp (-x)))/2 enddef ;
\stopMPinclusions
or if you prefer Hans' math definitions
\startMPinclusions
vardef sinh primary x = save xx ; xx = exp x ; (xx-1/xx)/2 enddef ;
vardef cosh primary x = save xx ; xx = exp x ; (xx+1/xx)/2 enddef ;
\stopMPinclusions
Jens
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-17 17:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-17 13:09 hyperbolic funtions in MP Peter Rolf
2003-05-17 15:17 ` Hans Hagen
2003-05-17 17:53 ` Jens-Uwe Morawski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).