More updates to ArcSpline and IP2

I have uploaded version 2.18 of the IP2 spreadsheet to:

IP2.zip

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:

 

This entry was posted in Arrays, Coordinate Geometry, Excel, Maths, Newton, UDFs, VBA and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.