Monday 17 December 2018

3-D Graph plotter

The Excel has been up dated for this. It now has animation macros. It is at 3-D graph plotter.xlsm. The new animations are in 3-D Graph plotter Version 2.... Read on.

I was doing exercise 2.06 in the book which was about a helix. I plotted the helix using Excel in a rather ad-hoc way. I wanted something better and more general so that I could plot any 3-D line on a view plane from the point of some viewer outside the view plane. I did it. Here is an animation of orbiting a big cube (100x100x100) and a small cube (10x10x10). The big cube is centred on the origin and so its bottom corner is at (-50.-50,-50). The small cube's bottom corner is at the same point, so we can easily locate the bottom corner of the big cube.
Orbiting a cube

The cubes are being viewed from a distance out of 230. The view moves in three phases:

1) The viewer moves from latitude 30°, longitude from 25° to 195° when after a short pause ...

2) Her longitude is held at 195° and her latitude increases over the North pole. There is a pause at 89.9° and 90.1°. (90° cannot be shown), At this stage the Z-axis has disappeared and the X- and Y-axes flip. Latitude 150°, longitude 195° is the same as latitude 30°, longitude from 15°. The viewer is almost back where she started.

3) Next there is a jolt as the direction of view changes from the origin to the centre of the small cube. Our intrepid viewer zooms in to distance of 100 and then back out to 230. The cycle repeats.

To get a more controlled journey round the sphere, you click here. You should see a list of the little gifs that make up the one shown here. Double click one and you can go through them like a slide show at your own speed.

The spreadsheet produces one image at a time, the animation was made with MS-Paint and GIF Animator. The Excel spreadsheet is at 3-D graph plotter.xlsx. It requires some expertise in Excel and scatter charts to use. It might be best to read the first two pages of 3-D graph plotter.pdf which give some instructions. The other 18 are devoted to developing and testing the Excel formulas needed.

A helix. The bottom quarter strand is red.


And here is the helix. It has radius 70 and goes up 2π every revolution. It appears to bend slightly around the Y-axis, but this is just a perspective effect.

This was my first excursion into 3-D Cartesian geometry and I was helped by the equations for lines and planes at https://brilliant.org



No comments:

Post a Comment