MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Re: 1/Trig function - help

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24277] RE: [mg24261] Re: [mg24248] 1/Trig function - help
  • From: Wolf Hartmut <hwolf at debis.com>
  • Date: Fri, 7 Jul 2000 00:11:21 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Andrzej,

changing the output format is definitely the best way, I think. But then you
need not rename Sin to sin nor Cos to cos. It suffices to take the HoldForm
of the original functions. This then gives undisturbed calculus and a
seemless, clear appearance in print:

 
In[1]:= Unprotect[Csc, Sec];
In[2]:= Format[Csc[x_]] := HoldForm[1/Sin[x]]
In[3]:= Format[Sec[x_]] := HoldForm[1/Cos[x]]
In[4]:= Protect[Csc, Sec];

In[5]:= D[Tan[x], x]
Out[5]=
   1    2
(------)
 Cos[x]

In[6]:= % /. x -> 0
Out[6]= 1

In[9]:= 1/Sin[y] 
Out[9]=
  1
------
Sin[y]

In[10]:= % Cos[y]
Out[10]= Cot[y]


> -----Original Message-----
> From:	Andrzej Kozlowski [SMTP:andrzej at tuins.ac.jp]
To: mathgroup at smc.vnet.net
> Sent:	Thursday, July 06, 2000 5:11 AM
> To:	mathgroup at smc.vnet.net
> Subject:	[mg24261] Re: [mg24248] 1/Trig function - help
> 
> Here is one simple way which may perhaps be satisfactory:
> 
> In[11]:=
> Unprotect[Csc, Sec];
> In[12]:=
> Format[Csc[x_]] := 1/sin[x];
> In[13]:=
> Format[Sec[x_]] := 1/cos[x];
> In[14]:=
> Protect[Csc, Sec];
> 
> 
> Now,  for example:
> In[15]:=
> D[Tan[x], x]
> Out[15]=
>    1    2
> (------)
>  cos[x]
> 
> You can still to comutations in the usual way:
> 
> In[16]:=
> % /. x -> 0
> Out[16]=
> 1
> 
> Andrzej
> -- 
> Andrzej Kozlowski
> Toyama International University, JAPAN
> 
> For Mathematica related links and resources try:
> <http://www.sstreams.com/Mathematica/>
> 
> on 7/5/00 4:22 AM, zhl67 at my-deja.com at zhl67 at my-deja.com wrote:
> 
> > Hello,
> > 
> > For some reason I wish the trigonometric functions to the power of -1
> > not automatically evaluated to some other trig functions. For instance,
> > I wish the out put of
> > 
> > In[1]:= Sin[x]^(-1)
> > 
> > remain unchanged or appears as
> > 
> > 1
> > Out[1]:=-------
> > Sin[x]
> > 
> > but NOT Csc[x]. Is there any cost efficient way to do this? Adding
> > rules to Power function might do(I only wish this feature for certain
> > argumentx x), but it slows down the Power function at the same time.
> > 
> > Liu Zhao
> > 
> > 
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> > 
> 


  • Prev by Date: Re: LogPlot != Plot[Log]
  • Next by Date: RE: LogPlot != Plot[Log]
  • Previous by thread: Re: 1/Trig function - help
  • Next by thread: Re: Re: 1/Trig function - help