More Python rotation functions

The code described in the previous post includes a Python function that rotates 3D coordinates by an angle defined with two vectors, using Rodrigue’s Rotation.  I have now added this function to the IP2_py spreadsheet, where it is used in the original application (fitting a circular arc to 3D data points), and also in the PView user defined function (UDF), to generate a perspective projection of any 3D framework.  The new spreadsheet and associated Python code may be downloaded from:

As well as the new functions, the update includes:

  • Updated Python and VBA code for the latest version of xlwings.
  • Updates to the Python GlobLoc3 and Gamma3 functions.
  • Python code re-named

Examples of the new PView and Fit_Circ3D functions are shown in the screenshots below:

As for the previous application, to use the spreadsheet:

  • If necessary, install Python, Numpy, and xlwings.  All the necessary packages are included in the default Anaconda Python installation.
  • Copy IP2_py.xlsb and to any convenient directory.
  • Run IP2_py.xlsb, and if necessary enable macros.


This entry was posted in Coordinate Geometry, Drawing, Excel, Link to Python, Maths, Newton, NumPy and SciPy, UDFs, VBA, xlwings and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

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

You are commenting using your 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.