MathGroup Archive 2005

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

Search the Archive

Re: TrigExpand - Odd behavior

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55434] Re: TrigExpand - Odd behavior
  • From: <wwolfe18 at comcast.net>
  • Date: Wed, 23 Mar 2005 05:34:44 -0500 (EST)
  • References: <d1on7b$nda$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Bob Stagat" <stagat at linkline.com> wrote in message 
news:d1on7b$nda$1 at smc.vnet.net...
>
> Try executing the following three lines and explain the last result...
>
> Cos[45 Degree]
>
> Cos[x+45 Degree]
>
> Cos[x+45 Degree]//TrigExpand
>
> Thanks...
> ~ BS ~

Bob,
This is just Mathematica insisting on giving exact answers. Put a decimal in 
somewhere.

Cos[x+45. Degree]//TrigExpand gives
0.707107 Cos[x]+I (0. Cos[x]+0. Sin[x])-0.707107 Sin[x]

Note the zero imaginary part. Get rid of it with Chop:

Cos[x+45. Degree]//TrigExpand//Chop  gives
0.707107 Cos[x] - 0.707107 Sin[x]

Warren Wolfe
Evanston, Il




  • Prev by Date: Re: Complex Variables
  • Next by Date: Re: Lines in Mathematica Graphics
  • Previous by thread: Re: TrigExpand - Odd behavior
  • Next by thread: Re: TrigExpand - Odd behavior