# Built-in Interpolation, ( ) vs [ ]

I noticed Igor returning values for waves in between the points where they were defined.

For example, take a wave called wave1 with 5 points (0,1,2,3,4). If you ask for print wave1(1.5), Igor looks like it will draw a line between points 1 and 2, and give you the value of the midpoint. Is this a general observation, and is there documentation about it anywhere?

Is there any difference between that and writing print wave1[1.5]? There doesn't seem to be in this context, but in the past I thought I had solved a problem by noting different uses between ( ) and [ ]. For example, assigning interpolated points (for which I used parentheses) to values in a wave (for which I used square brackets).

Specifically resultantwave[j] = wavetobeinterpolated(.732452*i)

The different indices were because I was taking data among many waves of a single value of "wavetobeinterpolated" (temporary name in a procedure) and assigning it to the points of resultant wave.

Thanks,
Matt
Actually there is a huge difference between () and [], and to be honest I am a bit surprised that you apparently have encountered rather few misbehaviors when using them interchangeably. I assume you don't use wave scaling so much then. So the difference is that [] takes the literal points of the waves. So wave1[1.5] will give you the value between point number 1 and 2 (note, this means NOT between point 1 and 2, since counting starts from zero). The () however will properly take the waves x scaling into account, so wave(1.5) may give you garbage if your wave happens to be scaled from, say, 200 to 900. You may want to read more about this by executing `DisplayHelpTopic "Indexing and Subranges"`
In addition I would recommend to have a look at
`displayhelptopic "The Waveform Model of Data"`
HJ