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:

IP2_py.zip

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 IP2_py.py.

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 IP2_py.py 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:

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.