I'm working on a problem where I need the parametric equation for a complex shape.

different shapes: circle, eclipse, rectangle, tube

Parametric equation of a circle:

 x = a * cos θ
 y = a * sin θ

Parametric equation of an ellipse:

 x = a * cos θ
 y = b * sin θ

Parametric equation of a rectangle, reference:

 x = a * (|cos θ| * cos θ + |sin θ| * sin θ)
 y = b * (|cos θ| * cos θ - |sin θ| * sin θ)

Parametric equation of a tubing with radius at the corners:

??  inputs = a, b and material thickness (i.e. corner radius = 2 * thickness)

The shape I'm trying to model is hollow rectangular steel tubing. As manufactured, hollow steel tubing has a 'corner' radius = two times material thickness, per standard ASTM A500-10.

Ultimately I'm working on a free tube notching calculator and pattern generator. I'd like to add a feature for rectangular tubing to rectangular tubing. I'm really relying on the parametric angular input to complete the model. I'm pulling out my hair trying to develop a functional parametric equation for the hollow steel outer shape (with radius at each corner) to use in my Descriptive Geometry analysis.

Any recommendations on how to proceed here to obtain a parametrized form of a rectangle with sized corner radius?

  • $\begingroup$ Do you insist on a parametric form? Otherwise a piece wise defined function will do the job. $\endgroup$ – Michael Hoppe Oct 8 '16 at 6:15
  • $\begingroup$ Basically, you want to corner fillet a rectangle? $\endgroup$ – J. M. is a poor mathematician Oct 8 '16 at 6:15
  • $\begingroup$ @Michael, you certainly could have piecewise functions as the components of a parametric equation. I imagine B-splines and ilk would be particularly useful. $\endgroup$ – J. M. is a poor mathematician Oct 8 '16 at 6:16
  • $\begingroup$ It can be a piece wise function (I'm just using JavaScript...) but I'm really relying on the angle theta, θ as the input. I can iterate θ, perform a test, chose formula A or formula B to obtain X, Y results, iterate and repeat no problem. But the whole thing depends on that angle as the input parameter. $\endgroup$ – zipzit Oct 8 '16 at 6:34
  • 1
    $\begingroup$ @zipzit : "why Knot" excellent pun. $\endgroup$ – Jean Marie Oct 8 '16 at 7:15

Piecewise vs Parametric

As discussed in the comments this can be done piecewise or parametrically. The difference is minor. Any pieces of a piecewise function can be joined into a single function by the following:

$$f(t)=\begin{cases} f_1(t) & a_0<t\le a_1 \\ f_2(t) & a_1 < t \le a_2 \\ f_3(t) & a_2<t\le a_3 \\ & etc\end{cases}$$


where $p[n,m,x]=\frac{1}{2}\left(1-\frac{|x-n|}{x-n}\cdot\frac{|x-m|}{x-m}\right)$. The function $p$ returns $1$ when $n<x<m$ and $0$ otherwise.

Piecewise Solution

$a$ is the horizontal "radius" of the pipe. I.e. the horizontal distance between the two sides is $2a$.

$b$ is the vertical "radius" of the pipe. I.e. the vertical distance between the two sides is $2b$.

$r$ is the radius of the corner pieces.

$$f(t)=\begin{cases} \{a,-(b-r)(2t-1)\} & 0\le t\le 1 \\ \left\{a-r+r \cos \left(\frac{1}{2} \pi (t-1)\right),-b+r-r \sin \left(\frac{1}{2} \pi (t-1)\right)\right\} & 1<t\le 2 \\ \{-(a-r) (2t-5),-b\} & 2<t\le 3 \\ \left\{-a+r-r \sin \left(\frac{1}{2} \pi (t-3)\right),-b+r-r \cos \left(\frac{1}{2} \pi (t-3)\right)\right\} & 3<t\le 4 \\ \{-a,(b-r) (2t-9)\} & 4<t\le 5 \\ \left\{-a+r-r \cos \left(\frac{1}{2} \pi (t-5)\right),b-r+r \sin \left(\frac{1}{2} \pi (t-5)\right)\right\} & 5<t\le 6 \\ \{(a-r) (2t-13),b\} & 6<t\le 7 \\ \left\{a-r+r \sin \left(\frac{1}{2} \pi (t-7)\right),b-r+r \cos \left(\frac{1}{2} \pi (t-7)\right)\right\} & 7<t\le 8 \end{cases}$$

This varies the parameter $t$ over the range $[0,8]$. If a range of $[0,2\pi]$ is required then just apply a scaling factor: $g(t)=f\left(\frac{4t}{\pi}\right)$

Image $(a=1,b=1,r=0.5)$

enter image description here

Image $(a=8,b=5,r=2)$

enter image description here

  • $\begingroup$ Ian, At first glance, pretty awesome work. I'm going to need a day to digest this, before accepting if that's okay? Is that a Matlab --> gif image? That -2rt characteristic blows me away with its simplicity. $\endgroup$ – zipzit Oct 8 '16 at 8:51
  • $\begingroup$ The graphic is done in Mathematica. I can add extra images (with different parameters if you like them). $\endgroup$ – Ian Miller Oct 8 '16 at 9:28
  • $\begingroup$ Your mention of the $2rt$ term highlighted a mistake in my method due to use $r=a/2=b/2$ in my test image. I've updated my answer. $\endgroup$ – Ian Miller Oct 8 '16 at 9:47
  • $\begingroup$ I think for 4 < t < 5 the line should read { −𝑎, (𝑏−𝑟)(2𝑡−9) } $\endgroup$ – aferriss Feb 21 at 18:36
  • $\begingroup$ @aferriss Thanks. fixed. $\endgroup$ – Ian Miller Feb 26 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.