next up previous contents index
Next: 6. GMT Map Projections Up: 5. GMT Coordinate Transformations Previous: 5.1.3 Cartesian power projection   Contents   Index

5.2 Linear projection with polar ($\theta , r$) coordinates (-Jp -JP)

Figure 5.6: Polar (Cylindrical) transformation of ($\theta , r$) coordinates.
\includegraphics{scripts/GMT_polar}

This transformation converts polar coordinates (angle $\theta$ and radius $r$) to positions on a plot. Now $x' = f(\theta,r)$ and $y' = g(\theta,r)$, hence it is similar to a regular map projection because $x$ and $y$ are coupled and $x$ (i.e., $\theta$) has a 360° periodicity. With input and output points both in the plane it is a two-dimensional projection. The transformation comes in two flavors:

  1. Normally, $\theta$ is understood to be directions counter-clockwise from the horizontal axis, but we may choose to specify an angular offset [whose default value is zero]. We will call this offset $\theta_0$. Then, $x' = f(\theta, r) = ar \cos (\theta-\theta_0) + b$ and $y' = g(\theta, r) = ar \sin (\theta-\theta_0) + c$.
  2. Alternatively, $\theta$ can be interpreted to be azimuths clockwise from the vertical axis, yet we may again choose to specify the angular offset [whose default value is zero]. Then, $x' = f(\theta, r) = ar \cos (90 - (\theta-\theta_0)) + b$ and $y' = g(\theta, r) = ar \sin (90 - (\theta-\theta_0)) + c$.

Consequently, the polar transformation is defined by providing

As an example of this projection we will create a gridded data set in polar coordinates $z(\theta, r) = r^2 \cdot \cos{4\theta}$ using grdmath, a RPN calculator that operates on or creates grid files.




grdmath -R0/360/2/4 -I6/0.1 X 4 MUL PI MUL 180 DIV COS Y 2 POW MUL = $$.nc
grdcontour $$.nc -JP3i -B30Ns -P -C2 -S4 --PLOT_DEGREE_FORMAT=+ddd > GMT_polar.ps
rm -f $$.nc


We used grdcontour to make a contour map of this data. Because the data file only contains values with $2 \leq r \leq 4$, a donut shaped plot appears in Figure 5.6.


next up previous contents index
Next: 6. GMT Map Projections Up: 5. GMT Coordinate Transformations Previous: 5.1.3 Cartesian power projection   Contents   Index
Paul Wessel 2010-11-01