I have uploaded version 2.18 of the IP2 spreadsheet to:
The new version includes updates to the IP, IP_4, and ArcSpline functions, as described below. The download is free and includes full open-source code.
The IP and IP_4 functions find all intersections of a pair of linear splines. The previous version allowed for only up to one intersection point per segment. This has now been modified to allow for the maximum number of possible intersections, as shown in the screen-shot below:
Other changes are:
- The intersection point code has been modified to avoid arithmetic problems with lines that are very close to horizontal or vertical, or near parallel.
- The input ranges will be automatically extended or shrunk to include the columns of continuous data below the top cell of the selected range.
The ArcSpline code has been modified so that it is no longer necessary to enter a sign for the radius of each arc. All arcs may be input as positive, and the function determines the placement of the arc centre from the directions of the two tangent lines:
The example above shows the final point defined without a radius, and the CloseArc optional argument set to False.
The ArcSpline function (and many other functions in this spreadsheet) returns an array of variable size, depending on the number of arcs listed, and the number of segments for each arc. The output listing may now be either automatically extended to show the complete array, or shrunk to a smaller range.
To reduce the size of the output range, select the desired range and press Ctrl-Shift-R:
To display the full results array, select the top-left hand cell, then press Ctrl-Shift-S.
The screenshot below shows a split screen after the output has been restored to its full extent, then the last point of the input was deleted, and the CloseArc argument was deleted. This results in the last line of the output displaying as #N/A, since the output array length is now one line less.
Press Ctrl-Shift-S again, with the top left cell selected, and now only the extent of the output data is displayed: