There is no PlotPlot routine to draw a straight line, because any straight line in physical coordinates can potentially turn into a curve in graphical coordinates. We therefore start by considering how to draw geodesic curves. These are curves which trace the path of shortest distance between two points in physical coordinates and are the basic drawing element in a Plot.
In many instances, the geodesic will, in fact, be a straight line, but this depends on the Plot's current FrameFrame. If this represents a celestial coordinate system, for instance, it will be a great circle (corresponding with the behaviour of the astDistanceastDistance function which defines the metric of the physical coordinate space). The geodesic will, of course, be transformed into graphics coordinates before being plotted. A geodesic curve is plotted using astCurveastCurve as follows:
Here, “start” and “finish” are arrays containing the starting and finishing coordinates of the curve. The astOffsetastOffset and astDistance functions can often be useful for computing these (ยง7.11).
If you need to draw a series of curves end-to-end (when drawing a contour line, for example), then a more efficient alternative is to use astPolyCurveastPolyCurve. This has the same effect as a sequence of invocations of astCurve, but allows you to supply a whole set of points at one time. astPolyCurve then joins them, in sequence, using geodesic curves:
Here, NPOINT specifies how many points are to be joined and NCOORD specifies how many coordinates are being supplied for each point. The array “coords” supplies the coordinates of the points in the Plot's physical coordinate system.