Mathjax test

This is a test of the new Mathjax plugin. Also, a quick little cheat sheet for right-angle trig identities; useful for calculating component forces of an angular force.

$$ o = h \, \sin \, \theta = a \, \tan \, \theta $$

$$ a = h \, \cos \, \theta = \frac {o}{\tan \, \theta} $$

$$ h = \frac {o}{\sin \, \theta} = \frac {a} {\cos \, \theta} $$


More calculator updates…

New calculators:

Other notable changes:

  • The Unit Conversion calculator now include electrical units
  • Added to the Constants page.
  • Added formula pages for each calculator (example)
  • Added diagrams to those that need them
  • Updated the jquery mobile library to 1.4.0.
  • Added a revision log
  • Most multi-page calculators were re-written to provide a simpler interface.
  • Some calculators now utilize drop-down menus to specify which variable to calculate for

Coming soon:

  • Parallel Key size and design calculator

If there is a calculator anyone wants to see, let me know. — cheers.

Ruby Shapes


What is RubyShapes?

RubyShapes is a Ruby library that defines Shape objects analogous to geometric cross-sections. These Shape objects “have” the same geometric properties that their real world counterparts do. The long term goal is to use RubyShape objects as building blocks for a larger structural and mechanical calculation software library.

Geometric cross sections?

These are cross sections of 3D objects (square rods, circular rods, rectangular tubing, etc.) Each shapes’ cross section has properties that are that are used in structural and mechanical calculations.

Current version?

The current version of RubyShapes is v0.2.9.1. It has been tested on Ruby 1.8 & later.


RubyShapes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at your option) any later version. RubyShapes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. For license specifics, see

Where is the source code?

The source can be found at the github RubyShapes repository.

Properties for each shape class

x = x dimension (in.) (equiv. to outer diameter for round shapes)
y = y dimension (in.) (equiv. to outer diameter for round shapes)
a = square area (in^2)
ix = second moment of area for xx (in^4)
iy = second moment of area for yy (in^4)
sx = section modulus for xx (in^3)
sy = section modulus for yy (in^3)
rx = radius of gyration for xx (in)
ry = radius of gyration for yy (in)
w = weight of shape per linear foot (lbs/ft) – right now assumes all shapes are steel

RubyShapes Structure:

RubyShapes.rb – the main file, contains the definitions & calculations for each shape class. There is a testing area at the bottom of the file.
Most of the shared code for RubyShapes is divided into several modules, each module lives as a file in the /lib/ folder:
DiagUtils Module – Diagnostic messages.
OutputUtils Module – Defines the methods that return values from the shape values.
ShapeUtils Module – Defines property calculations that are common to multiple.

List of Classes

Bar(x/y dimension) – Square bar shapes
Plate(x dimension, y dimension) – Rectangular bar shapes
Square_tube(x/y dimension, gauge/thickness) – Mild Steel As-Welded Mechanical Tubing
Rec_tube(x dimension, y dimension, gauge/thickness) – Mild Steel As-Welded Mechanical Tubing
Round_tube(outside diameter, thickness)
Rod(outside diameter) – Round rod shapes

Output Methods

These methods are used to retrieve the calculated properties from the shape objects.
Returns a human-readable list of the shape object’s properties (as floats, rounded to 4 places). Optional: include a (“variable”) parameter to the method to return that specific parameter’s value.
Returns a human-readable list of the shape object’s properties (as BigDecimals). Optional: include a (“variable”) parameter to the method to return that specific parameter’s value.
Returns the hash of Object properties (as floats, rounded to 4 places).
Returns the hash of Object properties (as BigDecimals).
Prints a pretty, human-readable header for the columns method. Spacing is not currently ideal.
Returns the Object properties in a column format (as floats, rounded to 4 places).

ShapeUtilites Methods

These methods are invoked by the shape classes during object initialization. They are not very useful to the end user.
Calculates corner radius for calculations. This method is not implemented yet.
Converts from steel gauge thicknesses to decimal thickness.
Calculates weight values – currently assumes all shapes are mild steel.
Builds a hash of the shape object’s properties. Result is stored in the shape object’s hash variable.

Diagnostics Methods

These methods mostly only run when DIAGNOSTICS = on.
Outputs a diagnostic section(header) line to the screen.
— message —
Outputs a diagnostic line to the screen
Outputs which class is currently initializing. Prints the following:
==== Now initiating a Rec_tube class ====
Prints Output Module Methods all at once for the receiver object. Good for batch testing the Output Module methods
Prints the classes for a predefined list of instance variables in the receiver object. DIAGNOSTIC flag independent.
Prints the values for a predefined list of instance variable in the receiver object. DIAGNOSTIC flag independent.
Not implemented yet. It will be a comprehensive diagnostic inspection for any object. DIAGNOSTIC flag independent.

(Good) Math Links

Ever wish you were better at math? Me too. I’ve been teaching myself calculus and stumbled on Better Explained, a blog with excellent math explanations. The author’s aim is to make math concepts intuitive. Now I actually understand what the imaginary number ‘i’ is all about; it wasn’t hard at all.

Sure most people think math is boring, but that’s because they probably don’t really “get” it. Don’t worry, it’s not your fault you don’t enjoy math. For those of us who endured a crappy (though deemed “standard”) math education, I point you to an article by Paul Lockhart called A Mathematician’s Lament. In it he describes the failings of the current K-12 math educational system. I felt both vindicated and angry as I read it. This is absolutely required reading.

Roll Bender Forces Chart

How much force does it take to bend 3”x16ga box tube to a 5’ radius in one pass? What’s the largest steel shape you can jam in a typical scene shop-built manual roll bender without cracking a roller? A week ago I didn’t know the answer to either one of these questions, now I’ve got a pretty good idea.

We’re talking about making a roll bender at work, and are waffling over whether to build a manual or motorized bender. I realized that we didn’t really have a handle on the forces involved in bending various steels to various radii; these numbers are instrumental when making this decision. (Not to mention during the design process.) Earlier this week I sat down and created an excel file to shed some light on the situation. Figured I might as well share it with my peoples.

Snag the files here: XLS or PDF

The majority of the worksheet calculates for:

  1. The force required to bend a variety of steel shapes to various radii in one pass (à la motorized bender).
  2. Adjustments for three different roller/die distances: 12”, 16” & 20” apart.

The manual pass sections are intended to show how much force would be needed when making the first pass in a manual roll bender. It calculates:

  1. The force required to reach the yield point of each steel shape.
  2. The resultant deflection and radius achieved in the first pass.
  3. The above calculations adjusted for three roller/die distances (12”, 16” & 20”).

Big effin disclaimer!
Lets be honest folks, I’m not an engineer. Confidentially (just between you and me) I am confident that the calculations are fairly accurate. But under no circumstances will I claim that they are 100% accurate. The reason is this: the last thing I need is a lawsuit because someone too lazy to verify the math took it in the eye from a flying bit of steel. Don’t you dare cut corners.

This worksheet is only intended to give a general idea of the numbers involved when bending steel. It cannot be counted on to give precise data concerning specing and designing of a specific machine. There are no allowances for the inherent springy-ness of mild steel, dodgy steel quality and varying manufacturing tolerances.

Bending steel is indeed a fudgy art. But now you’ve got some numbers.