3D Intersections

Following a discussion at the Eng-Tips Forum, I have written an Excel User Defined Function (UDF) to find the intersection point of two 3D line segments.  The UDF has been added to the IP2 spreadsheet, which is available for free download (including full open source code) from IP2.ZIP.

The method of calculation of the intersection point is:

  1. Check if either End of Line2 is coincident with either end of Line1.
  2. Check if either end of Line2 lies on Line1.
  3. Check for quick 2D solution, if both lines lie on a plane parallel to the XY, XZ or YZ planes.
  4. Check that lines lie in the same plane, i.e distance of End2 of Line2 from the plane formed by Line1 and End1 of Line2 is zero.
  5. Find 2D IP of lines projected on to XY, XZ, and YZ planes.
  6. Check that the IP is within the length of each line segment.
  7. Extract the IP X,Y, and Z coordinates and assign to the function return value.

The screen shots below show for two 3D line segments:

The intersection point found using the new UDF (IP3D):

IP3D example

On spreadsheet calculation for the same two lines, using the UDF IP() (Example 2), and using only built in Excel Functions (Example 3)

On spreadsheet calculation of IP

and graphs of the two lines projected on to the three axis planes:

Projected intersecting lines

Posted in Coordinate Geometry, Excel, Maths, Newton, UDFs, VBA | Tagged , , , , | 7 Comments

Laterally Loaded Piles and a Safety Device for Walking on Icy Pavements

What do laterally loaded piles:

Pile loading test

and a safety device for walking on icy pavements:

have in common?

Apart from their obvious utility, both are the subject of learned papers, freely available at the Virginia Tech Digital Library and Archives, along with 18,762 Electronic Theses and Dissertations.

For the full papers see:

Investigation of the Resistance of Pile Caps to Lateral Loading and

Introducing Engineering Design Through an Intelligent Rube Goldberg Implementation

or search the entire archive at: Virginia Tech Digital Library and Archives

Posted in Geotechnical Engineering, Newton | Tagged , | Leave a comment

More links

One of the nice things about running a blog is that visitors leave the address of the site that lead them here, and if you follow these links back it sometimes takes you to fascinating sites that you would  never have otherwise seen (sometimes it also leads to the most tedious spam imaginable, but we won’t go into that).

So this evening I have discovered:

Pfadintegral dotCom – a quantitative finance site, but if they are happy to link to an engineer, I’m happy to return the favour.

And from their resources page:

Robert de Levie – Excellaneous a fellow “engineers and scientists” site.  Very un-flashy presentation, all on a single page, but lots of good content.

Visual Basic Tutorials – what it say, tutorials on VB (not VBA), and again excellent content

Visual Basic Secrets  – what they say about themselves: “”Here’s the thing though… even VB programmers that have been in the industry for years don’t realize the real power of VB because they don’t grasp (or realize) a few key concepts and functionalities that VB offers. These concepts aren’t taught, or at least are not emphasized the way they should, so I call them “VB SECRETS”.”

Posted in Excel, VBA | Tagged , , | 1 Comment

XNumbers and Tropical Events

My on-line friend Al Vachris recently sent me a link to the Tropical Events site, which features a detailed analysis of the orbital motion of the Earth and the other bodies of the solar system, all done in Excel, and all available for free download:

This is a great site, and well worth a visit for anyone interested in astronomy or the scientific application of Excel, but what really grabbed my interest was that the author had used the XNumbers add-in in preparing his charts, and he had got his brother to update the program for Excel 2007/2010.

Xnumbers is a free open-source maths add-in, offering a huge number of additional maths functions and extended precision arithmetic.  It was developed by Leonardo Volpi and the “Foxes Team” in Italy, but it had not been updated for Excel 2007.  Steve Beyers, the author of the Tropical Events site, got his brother, John Beyers, to do the necessary update, and also to compile the functions with a resulting performance improvement.  The new version, XNumbers6.0, can be downloaded from:

XNumbers6.0

The download includes an excellent detailed help file.  Further information is available at:

THE VOLPI XNUMBER ADD-INS: (This is summary material extracted from the site http://digilander.libero.rt/foxes. It is presented as an explanation on how xnumbers works in an Excel environment.)

The Foxes Team site Detailed documentation of XNumbers and related maths topics from the original authors.

It is excellent news that this software is now available for Excel 2007/2010, and I recommend the sites linked above to anyone wanting to do advanced numerical analysis inside Excel.

Posted in Excel, Maths, Newton, Numerical integration | Tagged , , , | 16 Comments

Double Exponential Quadrature

Graeme Dennes has updated his Tanh-Sinh Quadrature spreadsheet to include Double Exponential Quadrature.  His brief notes are given below, and more details and links to background information are included in the download file.

=================================================================

Double Exponential Quadrature UDFs added to Tanh-Sinh Quadrature workbook.

Two Double Exponential (DE) quadrature UDFs to calculate the numerical integral of a function over the semi-infinite interval (a,inf) have been added to the Tanh-Sinh Quadrature workbook. The UDF named DE_QUAD will integrate non-oscillatory integrals, ie, those without periodic trigonometric functions like sine, cosine, etc, while the UDF named DE_OSC_QUAD will integrate oscillatory integrals.

Like the Tanh-Sinh program, the two DE programs provide excellent performance, primarily because the three programs are based on the Double Exponential quadrature technique (developed by Takahasi and Mori in 1974).

The revised zip file may be downloaded here: Tanh-Sinh and DE Quadrature.zip.

Note:  New version (1.51) with minor corrections uploaded 9 Mar 2011.

=================================================================

DE-Quad Function Examples; click for full size view

Posted in Excel, Maths, Newton, Numerical integration, UDFs, VBA | Tagged , , , , , | 1 Comment