Basic geometrical operations are the core of any data processing program. Also Gwyddion has a wide set of functions for data scaling, rotation, resampling or profile extraction. In this section the main algorithms behind these functions will be described and the list of available modules will be presented.
A large number of the morphological operations in Gwyddion are dependent on data interpolation. As the SPM data are relatively coarsely sampled compared to measured details (full images are typically only a few hundred pixels in width and height), the interpolation method used can become critical for proper quantitative analysis of data properties. There are several interpolation methods [1] in 1D and 2D implemented in Gwyddion and the user can choose which method to use for most of the modules using interpolation.
Here, we describe 1D interpolation method principles. All implemented 2D interpolation methods are separable and thus simply composed of these 1D methods. The following interpolation method are currently available:
Round interpolation (also called nearest neighbourhood interpolation) is the simplest method – it just takes round value of the expected position and finds therefore the closest data value at integer position. Its polynomial degree is 0, regularity C-1 and order 1.
Linear interpolation is a linear interpolation between the two closest data values. The value z at point of relative position x is obtained as
where z0 and z1 and values at the preceding and following points, respectively. Its polynomial degree is 1, regularity C0 and order 2. It is identical to the second-order B-spline.
Key interpolation (more precisely Key's interpolation with a = −1/2 which has the highest interpolation order) makes use also of values in the before-preceding and after-following points z-1 and z2, respectively. In other words it has support of length 4, The value is then obtained as
where
are the interpolation weights. Key's interpolation degree is 3, regularity C1 and order 3.
Schaum interpolation (more precisely fourth-order Schaum) has also support of length 4. The interpolation are
Its polynomial degree is 3, regularity C0 and order 4.
Nearest neighbour approximation is again calculated from the closest four data values but unlike all others it is not piecewise-polynomial. The interpolation weights are
for k = -1, 0, 1, 2, where r-1 = 1 + x, r0 = x, r1 = 1 − x, r2 = 2 − x. Its order is 1.
B-spline was misimplemented up to version 2.1 (inclusive) and it blurred data. It should be avoided in these old versions. The weights are
However, they are not used with directly function values as above, but with interpolation coefficients calculated from function values [1]. Its polynomial degree is 3, regularity C2 and order 4.
O-MOMS was misimplemented up to version 2.1 (inclusive) and it blurred data. It should be avoided in these old versions. The weights are
However, they are not used directly with function values as above, but with interpolation coefficients calculated from function values [1]. Its polynomial degree is 3, regularity C0 and order 4.
Figure 4.1. Illustration of the available interpolation types (the original pixels the interpolation is performed between are obvious on the result of Round interpolation). All images have identical false color map ranges.

Within basic modules it is possible to perform the following operations with 2D data field:
Moreover, calibration module can be used for changing the information about image physical dimensions and changing the data values calibration: → → .
The simpliest method of reading values is to place the mouse cursor over the point you want to read value of. The coordinates and/or value is then displayed in the statusbar. This method works both with data windows and graph windows.
Tool Read Value offers more value reading posibilities: It displays coordinates and values of the last point of the data window the mouse button was pressed. It can avergae the value from a circular neighbourhood around the selected point, this is controlled by option Averaging radius. When the radius is 1, the value of a single pixel is displayed (as the simpliest method does). In addition it can display the inclination of the local facet. Averaging radius again determines the radius of the area to use for the plane fit. Button shifts the values to make the current z the new zero.
In all Gwyddion tools facet and plane inclinations are displayed as the spherical angles (ϑ, φ) of the plane normal vector.
Angle ϑ is the angle between the upward direction and the normal, this means ϑ = 0 for horizontal facets and increases with the slope. It is always positive.
Angle φ is the counter-clockwise measured angle between axis x and the projection of the normal to the xy plane, as displayed on the following figure. For facets it means φ corresponds to the downward direction of the facet.
Figure 4.2. Surface facet (displayed blue) orientation measured as the counterclockwise angle from x-axis to the projection of facet normal vector n to xy plane.

Distances and differences can be read with Distance tool. It displays the horizontal (Δx), vertical (Δy) and total planar (R) distances; the azimuth φ (measured identically to inclination φ) and the endpoint value difference (Δz) for a set of lines selected on the data.
The list of distances can be saved to a text file with button.
Profile extraction tool can be accessed from the tools menu bar. You can use mouse to drag several profiles in the image that can be further moved and adjusted. Profile graph preview can be seen in the profile tool dialog. Profiles can be of different “thickness” which means that more neighbour data perpendicular to profile direction are used for evaluation of one profile point for thicker profiles. This can be very useful for noise suppression while measuring some regular objects.
After profiles are chosen, they can be extracted to graphs (separate of merged in one Graph window) that can be further analysed using Graph functions.