# More information about interpolation

Interpolation range

To interpolate points, EthoVision XT needs complete samples immediately before and after the sample to be interpolated. 'Complete samples' means that:

▪For Only center-point detection, the Center point of the adjacent samples must not be missing.

▪For Center-point, nose-point and tail base detection:

▪If you chose Interpolate the selection on the toolbar, all the three points of the adjacent samples must not be missing.

▪If you chose Interpolate center points on the toolbar, the Center-point of the adjacent samples must not be missing.

If the samples adjacent to the selected range are not complete, EthoVision XT searches for the first complete sample before and after that sample (or range). Therefore, all (incomplete) samples in the middle are included in the range to interpolate.

example The missing samples 5 and 6 in the picture below have been selected for interpolation. Samples 4 and 7 are adjacent to the range, but not complete: sample 4 lacks the nose-point, while sample 7 lacks the tail-base point (missing points and connectors look faded here).

▪If you choose to interpolate the entire selection, EthoVision XT needs the coordinates of the three points for both adjacent samples in order to calculate the coordinates of the three points of samples 5 and 6. Therefore, samples 4 and 7 are not used. Instead, the complete samples 3 and 8 are used as adjacent samples, so the interpolating range is extended to samples 4 and 7 (see the open dots below). The coordinates of the missing points of samples 4 to 7 are calculated.

▪If you interpolate only the center points, EthoVision XT needs the coordinates of the center points for the adjacent samples in order to calculate the coordinates of the center-points 5 and 6. Sample 4 and 7 are used because they are the first previous and next samples with valid center-points, respectively. The interpolating range is not extended (see the open dots below). The coordinates of the missing center-points, not nose-point and tail-base points, of samples 5 and 6 are calculated.

How the center point is interpolated

The center-points of the selected samples are a linear interpolation between the first previous non-missing center-point and the first next non-missing center-point found around the interpolating (expanded) range.

Below: Linear interpolation of two center points. Left: Select the two points. Right: After interpolation. The arrows indicate the interpolated points.

If your track contains nose-point and tail-base, interpolation of center-points is independent of whether you choose to also interpolate nose-point and tail-base. In any case, center-points are interpolated first.

How the nose-point and tail-base point are interpolated

Nose-points and tail-base points are always interpolated after the center-points have been found (see above), and their interpolation is dependent on the orientation of the non-missing nose-points and non-missing tail-base points immediately preceding and following those missing samples, respectively.

Before interpolation, the missing points are indicated as a linear interpolation between the first previous and the first next non-missing points of their type.

The direction of movement does not play any role in interpolation.

Consider the following example with three missing samples (missing nose- and tail-base points are not shown for clarity):

First, center points are linearly interpolated:

Second, for the two adjacent non-missing samples, the program determines:

▪The length of the segment joining the center and the nose- (or tail-base) points.

▪The angle formed by this segment and the horizontal x-axis generating from the center point (this angle can be either positive or negative depending on whether the segment lies above or below the axis).

The picture below shows this step for the nose point only:

Third, the program calculates the interpolated values of segment length and angle for the missing points, using linear interpolation of the values obtained in the previous step.

So for example:

▪If the length of the center-nose point segment for the two adjacent samples is 50 and 10 mm, respectively, then the length of the three segments joining the interpolated nose-points and their center points will be 40, 30 and 20 mm respectively.

▪If the orientation of the center-nose point segment for the two adjacent samples is 90 and -10 degrees, respectively, then the orientation of the three segments joining the interpolated nose-points and their center points will be 65, 40 and 15 degrees respectively.

The second and third step is repeated to interpolate the tail-base points.

Interpolating points at the beginning or end of the track

If the range of missing points to interpolate is at the beginning or the end of the track, the missing points are not interpolated. This is also the case when you want to interpolate nose- or tail-base points at the beginning/end of the track and the corresponding center points are non-missing.