Igor keeps prompting an error message

Dear everyone

I was trying to load a XRD pattern into Igor and use it to rescale from '2theta' to 'k'.

Upon loading I renamed wave0 & wave1 to '2theta' & 'int' respectively.

then,

Duplicate '2theta' 'k'

'k'=2*[sin('2theta'/2)]/1.5425

but Igor keeps prompting up an error message saying "unknown or inappropriate name or symbol", when in fact I was using exactly the wave names I just defined.

I seldomly experience the same kind of problem in the past.

So, does anyone know what's the problem? Is it because igor doesn't realise the square bracket []?

I guess it's because when you use square brackets Igor expects an x-value or a x- range of a wave. So in this case it doesn't know what to do.

Just a comment: I personally would avoid liberal names, e.g. 2Theta, which needs to be addressed with ' '. This is asking for trouble especially in user functions. I'd call the wave TwoTheta instead. And for the wave k you don't need single quotes.
The square brackets are the problem. They are used only for wave indexing. For grouping in expressions you can only use parentheses, even though it makes it harder to read. Remember, this is code, not mathematical equations!

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com