MathGroup Archive 2005

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

Search the Archive

Re: TrigExpand - Odd behavior

"Bob Stagat" <stagat at> wrote in message 
news:d1on7b$nda$1 at
> 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 ~

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

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