The updated applets on the Graphs of tan, cot, sec and csc page now run on mobile devices, albeit rather slowly. One of the most popular pages on IntMath.

The post Updated Graphs of tan, cot, sec and csc appeared first on squareCircleZ.

]]>To make the page more mobile-device friendly, I updated it so now the interactive graphs use JSXGraph, rather than Flash.

The page explains how to sketch these trigonometric curves, mostly by considering the denominator (the bottom) of the function expression.

Each of the curves tan *θ*, cot *θ*, sec *θ* and csc *θ* has a discontinuity, or "gap" in the curve. For example, tan *θ* is defined by:

Since cos *θ* has value 0 at *θ* = … −3π/2 −π/2, π/2, 3π/2, 5π/2,…, it means tan *θ* will not exist for those values of *θ*. The result is there will be "gaps" in the curve at those points.

Either side of those gaps, the curve heads off to plus or minus infinity. Here is the graph of *y = *tan *θ*:

The page has animations that demonstrate where the values of the curves come from.

Here’s a screen shot of one of the animations:

On a tablet, the animations may run a little slow. After all, we’re asking the processor to perform a lot of calculations! Alo, the screen gets re-drawn multiple times during the animation, which also slows things down.

As a result, you can only animate one of the graphs at a time.

The link again:

Graphs of tan, cot, sec and csc

The post Updated Graphs of tan, cot, sec and csc appeared first on squareCircleZ.

]]>Here's some background on the new Riemann Sums applet I added to IntMath. You can see how we find areas under curves using rectangles.

The post New Riemann Sums applet appeared first on squareCircleZ.

]]>I recently added a new Riemann Sums Applet to IntMath which demonstrates some of the ways it can be done, without calculus.

Here is some background to the concept.

For centuries, mathematicians tried to find efficient ways of calculating rates of change. They needed to solve a wide range of practical problems, including building faster ships, developing more accurate weapons and predicting the positions of the stars and planets for better navigation.

They were also interested in the reverse problem. That is, they may have known the rate of change, but they wanted to know the fundamental relationship between two changing quantities. For example, they may have known the velocity of an object at different times, and they wanted to know the position of the object in space during those times.

Since the age of the ancient Greeks, there were good approximation methods for such problems.

A Riemann Sum is an approximation of the area under a curve (that is, between a curve and an axis). It’s named after Bernhard Riemann, the German mathematician who worked on this problem in the mid-19th century.

The principle behind Riemann Sums is simple, and was known since the time of Archimedes. (See Archimedes and the area of a parabolic segment.)

We just divide the area into smaller pieces using simple geometric shapes for which we can easily find the area, like rectangles.

If we find the area of each rectangle, and add those areas, we’ll get a good approximation for the area under the curve. If we take more rectangles, the error will reduce, and we’ll get a better approximation.

We can place the rectangles in different ways (just above the curve, just below, or mid-way like in the above image).

I recently added a new applet that allows you to explore this concept. You can change the placement of the rectangles, and you can even see how trapezoids and parabolas are used as very good approximations.

You’ll find the new applet here: Riemann Sums Applet

The post New Riemann Sums applet appeared first on squareCircleZ.

]]>What is the length of a spiral around a paraboloid? This is an interesting application of integral calculus, involving an environmentally friendly cooker design.

The post Arc length of a spiral around a paraboloid appeared first on squareCircleZ.

]]>A reader from Africa, Magnar, recently asked about running a string in a spiral around a parabolic dish, as illustrated in the following image:

Magnar wanted to know how to calculate the length of such a spiral.

There’s an interesting story behind Magnar’s question. He builds parabolic dish cookers in Africa. In this photo, he’s helping to install one of his dishes in a village. The dish concentrates the heat of the sun and the cook pot is placed at the focus of the parabola.

Image source (used with permission)

This is a great use of sustainable energy, it keeps the air cleaner (by avoiding open fires inside huts), and saves women from the backbreaking and time-consuming task of gathering firewood every day.

Let’s look at some of the math behind this problem.

A paraboloid is the 3D surface resulting from the rotation of a parabola around an axis. The equation of a simple paraboloid is given by the folmula:

*z* = *x*^{2} + *y*^{2}

The surface generated by that equation looks like this, if we take values of both *x * and *y* from −5 to 5:

Some typical points on this curve are (0,0,0), (1,1,2), (-2,3,13) and (3,4,25). That last point is on the top lip of the surface in the 3-D graph given above, at the front, facing us. (In this graph, the *x*- and *y*-axes axes are equally scaled, but the *z*-axis is not.)

We can also represent this paraboloid using parametric equations with variables *t* and *r*, as follows:

*x = r *cos(*t*)

*y = r *sin(*t*)

*z* = *r*^{2}

We could write this as an ordered triple, like this:

(*r *cos(*t*), *r *sin(*t*), *r*^{2})

We only need to let *t* take values from 0 to 2π (otherwise we just "paint" the surface more than necessary) and *r* takes values from 0 to 5 if our aim is to create the same curved surface as shown in the above graph.

Let’s get back to the original problem. We want to create a spiral around the surface of the paraboloid. We modify the earlier parametric equations to get a curve rather than a surface, like this.

*x = t *cos(*t*)

*y = t *sin(*t*)

*z* = *t*^{2}

Once again, we could write this as an ordered triple, as follows:

(*t *cos(*t*), *t *sin(*t*), *t*^{2})

We no longer create a surface with this expression. Instead, it will be a curve.

As the variable *t* takes various values starting from *t* = 0, it generates a spiral around the 3-D surface.

Let’s see how, starting with a simple case.

Let’s consider the case where we fix the curve so it is in the *x-z* plane only (it’s not actually spiralling in this case, to make things simple.) We write this as:

(*t*, 0, *t*^{2})

The graph of this is part of a parabola, starting at (0,0,0) and extending to (20,0,400), as shown.

What is the length of this simple curve?

We use a result from calculus, which is based on the Pythagorean Theorem.

The arc (or curved) length is given by:

(See Arc Length of a Curve and Arc Length of a Curve in Parametric or Polar Coordinates for background on these formulas.)

In this example where *x* = *t* and *z* = *t*^{2},

and

Also, in this example we have the end point *t*_{1} = 20.

Substituting gives:

(I used a computer algebra system to find this integral.)

This seems quite a low firgure for the length, since the *z*-value at the end of the curve is 400, and going around the curve should add more than just over 1 unit to the length.

However, the above graph does not have equally-scaled axes, whereas the following one does.

We see that a parabola is "almost" straight, and a curve length of just over 400 for this curve is reasonable.

Let’s now see the effect of those trigonometric terms we saw before.

We now plot (*t *cos(*t*), *t *sin(*t*),* t*^{2}) for *t* = 0 to *t* = 20. (Of course, *t* is in radians.)

The start of the curve, when *t* = 0, is at the point (0,0,0). The point where the curve finishes, when *t* = 20, is:

(20 cos(20), 20 sin(20), 20^{2}) = (8.162, 18.259, 400).

For interest, looking from above (down along the *z*-axis), the above spiral looks like this:

The arms cut the *x*-axis evenly at 2π = 6.28, 4π = 12.57, and 6π = 18.85.

You can see the curve ends near (8, 18) as we claimed before.

We extend the 2-dimensional case above now that we are working in 3 dimensions. In general, the length of an arc when using the parametric terms ((*x*(*t*), *y*(*t*),* z*(*t*)) is given by:

Substituting in our expressions for * x*, *y* and *z*, we have:

Now to examine the solar cooker problem.

Considering one of Magnar’s cooker designs, the parabola has a cross-section which is quite flat compared to the paraboloid we drew above. (Like most parabolic dishes, they are using flat panels to approximate the curved surface.)

In fact, the top lip passes through the point (25,45) in that design. The general form of a parabola can be written:

*z = cx*^{2}

Substituting (25,45) gives us .

We now plot the curve

from *t* = 0 to *t* = 45.

The curve starts at (0,0,0) and the top point is (23.6, 38.3, 45). We see there are about 7 spirals.

Here it is from the side:

And next the view from the top shows we finish near *x* = 24 and *y* = 38:

We have around 7 turns in the above spiral, but we may need more or less. If we want to achieve more spirals within the same *x-, y-, *and *z-*constraints, we need to multiply the variable within the trigonometric terms by a number.

Here is the case when we multiply the variables in the trig terms by 5. That is:

We get around 35 spirals this time:

Here it is from the side.

The length of this spiral is:

Similarly, if we multiply those variables by a number less than 1, we get less spirals. Here is the case when we multiply by 0.3:

This time we have just over 2 spirals (which is similar to the situation we had in Magnar’s first diagram at the top) and our length is:

This has been an interesting application of math where 3-D geometry and integral calculus are being used to examine a good use of solar power. We need to make more use of the huge amount of energy available from the sun, and solar cook pots are a great way to do so.

The post Arc length of a spiral around a paraboloid appeared first on squareCircleZ.

]]>The post From brain injury to math genius: Jason Padgett appeared first on squareCircleZ.

]]>Jason Padgett was attacked by 2 men one night and savagely beaten. He ended up with severe concussion and an amazing new ability to "see the world through the lens of geometry".

He began to create intricate geometric art, like this image:

See the full story at Discovery.com: Brain Injury Turns Man Into Math Genius. Don’t miss the gallery of his art while you’re there.

Padgett’s story reminded me of the work of Alan Snyder, the Sydney-based researcher who is able to temporarily "turn on" savant-like mathematical abilities in test subjects. (See Switching on your inner Rainman: Enhancing Creativity).

Snyder uses magnetic pulses through the brain to release what he believes are math and creative abilities inherent in all of us.

Padgett wouldn’t change his new abilities if he could.

"It’s so good, I can’t even describe it," he said.

It’s fascinating that Padgett has discovered the joys of math patterns, but it’s very sad it took a violent event to bring it about.

The post From brain injury to math genius: Jason Padgett appeared first on squareCircleZ.

]]>Google tries hard to provide super-fast Web pages, and uses calculus in the process.

The post Google uses integration to speed up the Web appeared first on squareCircleZ.

]]>Google’s success as a company was built on **optimization**. They’ve put a lot of effort into making everything they do super fast.

Google wants all pages to be fast, so they provide a free Web page speed test facility, WebPageTest.org. You can test any page there and see why it is so slow (or fast). It’s great for those of us who are keen on speeding up our sites.

Of course, there are many things that will slow down a page, including slow Net connections, a slow server, size of the page (in kb), slow download speeds and slow browser processing speeds.

WebPageTest provides various test result measures, including connection time, download times and a metric called **Speed Index**.

Speed Index is an indication of how quickly the page elements appear on a page. In some cases, we see just a small part of the page and then see the browser "spinner" indicating more is to come (we are likely to leave in such cases). On other pages, we may see most of the page quickly, but the spinner indicates some more is coming.

Obviously the second cane is a better user experience, so it should get a better Speed Index score.

The Speed Index documentation explains how they calculate the score. It involves finding the **area under a curve**, which is a concept we learn when first meeting integral calculus.

They give a formula:

where

*T* is the "visually complete" time (total time to load and process the page); and

*VC*/100 is the "percent visually complete".

The areas are calculated at 0.1 s intervals (or similar) and added to produce the final index.

The area represented by the integral is the darker blue area in this chart, which represents a fast Web page (most of the content is visible quickly and the last 10% or so appears later).

[Image credit: WebPageTest]

So in fact, we are finding the **area between 2 curves,** the top one is the constant value 1 (or 100%), and the other is the VC curve.

Some closing ironies:

- The documentation page referred to above took around 27 seconds to "visually complete" status when I opened it today. They haven’t even optimized images on that page to reduce the download time.
- Google is not always quick. Gmail has many elements and takes a long time to load when first opened.

The post Google uses integration to speed up the Web appeared first on squareCircleZ.

]]>The post Friday math movie: 5 Quick Math Tricks for Filmmakers appeared first on squareCircleZ.

]]>Here are some math-related tips for better movies.

He discusses the f-stop scale, what an appropriate shutter angle is, the 180-degree Rule and Rule of Thirds, and how to read a histogram.

Actually, there are plenty of potential interesting math lessons arising from this. How about get students to make relevant videos about the math they are using, while making videos!

The post Friday math movie: 5 Quick Math Tricks for Filmmakers appeared first on squareCircleZ.

]]>The post Friday math movie: Falling in love with primes appeared first on squareCircleZ.

]]>He mentions the largest current prime, which is around 12.5 million digits long.

Monster, indeed.

The post Friday math movie: Falling in love with primes appeared first on squareCircleZ.

]]>Here's some math background behind the recently updated pulley applet.

The post Pulleys interactive applet: math background appeared first on squareCircleZ.

]]>As I developed it, I used quite a bit of interesting math.

I get quite a few mails from people asking how I develop these applets, so here is some mathematical background.

The 2 circles are built using the basic formula for a circle:

The left-hand circle has center (0,0), (I could have placed it anywhere on the *x-y* plane, but (0,0) seemed simplest), and the radius it has at the start is 5. So its equation is:

The right hand circle has center (15,0) and radius 2 at the start.

If the circle has center other than the origin, say (*h,k*), we use this formula:

So the equation of the right hand circle is:

[JSXGraph allows us to easily draw circles with different centers and different radii (without resorting to the formulas), but I still needed to make use of the formulas for later steps.]

I have hidden the axes for the applet to make it cleaner.

The red dot follows the belt around. It travels through 2 circular arcs, and 2 straight line segments.

I needed to find the intersection point of the arcs with the straight line segments. This could be done using either Non-linear systems of equations or via other geometric constructions.

Of course these intersection points change when the radius of each wheel changes.

I assumed no gravity was operating on the belt, and that it is (very) tight.

The red dot follows 2 line segments. I needed to find the equation of those segments. So I needed to use the basic equation for a straight line with slope *m* and *y*-intercept *c*:

To find the actual values of *m* and *c*, I needed to use the following formula, once I found the intersection points and :

The red dot travels around 2 circular arcs, and there are points (the circles) on the pulley wheels that rotate around a center as well.

I needed to use the following parametric equations, where *r* is the distance from the center to the rotating point, to achieve this:

As time goes on, the angle *θ* changes (it’s in radians, of course), and the point sweeps out a circle. The starting point is (*r*, 0) when θ = 0.

Of course, the whole point of the applet is to demonstrate the relationship between linear and angular velocity, one of the applications of radian measure. Our basic equation is:

*v = rω*,

where

*v* is velocity in meters/second (m/s)

*r* is radius in meters (m)

*ω* is angular velocity in radians per second (rad/s)

I find I understand new formulas more easily when I can see the units.

Pulleys are used to make our lives easier (e.g. gears on a bicycle, or for lifting weights) and they work when there is a difference in the radius between the 2 pulley wheels. So we may need to pedal faster on a bike when in a low gear, but the advantage is we don’t have to push so hard.

The applet shows the difference in angular velocity between the larger wheel (lower angular velocity) and the smaller wheel (higher angular velocity).

It turns out the ratio of the angular velocities is the inverse of the ratio of the radii of the 2 wheels.

In programming, we can come across 2 kinds of functions:

- A
**set of commands**that is used over and over (for example there is a function that draws the pulley wheels and the segments, adn this function is called each time you change the radius of a wheel, and the function that moves the red dot and other points around) - The
**mathematical-type function**. In this applet, I make use of sine and cosine functions (as well as inverse sine and cosine) to create the parametric equation points I mentioned earlier.

I also needed to use the concept of shifted trigonometric functions (ones where the curve does not start at 0).

This is actually a relatively simple applet. Programming such applets – and most games – involves a lot of interesting math!

The post Pulleys interactive applet: math background appeared first on squareCircleZ.

]]>A manufactures of range hoods with curved sides wants to know what shape to cut the sheets.

The post Range hood curved sides problem appeared first on squareCircleZ.

]]>I am a consultant to cabinet manufacturers. I program their cabinet software to calculate and cutout their cabinet parts on CNC (computer numerical control) machines. A lot of cabinet companies create hoods that go over stoves that are curved on both sides and front. I need to calculate the joint of that curve as if it is laying flat. How do you calculate this?

John provided a picture of one of the typical hoods that he is talking about.

What he needs is a formula to plot the Y coordinate of the curve given the X or vice-versa.

This was an interesting problem that involved some actual "real world" applications of math.

The requirement was for a "curved side" with no other specifications, so I proceeded as follows, based on the picture he supplied.

I happen to have a Chinese lamp shade which also has curved sides and it’s very similar to the image he sent, so I used that as a model to make sure what I had was OK. I like to work with concrete materials first to give me a better feel for what is going on.

I used a piece of paper to outline one side of the shade, then measured the side of the paper (laid flat) in 5 locations and using Cartesian coordinates, it looked like this:

For the diagram above, I used my favorite tool for this kind of job, GeoGebra (a free open source tool.)

In Geogebra, it’s simple to ask for a polynomial passing through the 5 points, using the following syntax:

Polynomial[A,B,C,D,E]

While it was potentially a quartic (because it passes through 5 points), Geogebra decided a parabola would do the job:

f(x) = 0.03x^2 – 0.64x + 14

**NOTE 1: **I moved the curve on its side because points AB are almost vertical otherwise, and that gives messy polynomials. It’s much smoother if the curve is almost horizontal.

If we had proceeded with the curve in upright mode, the points would have looked like this:

With the points almost vertical, the resulting polynomial is a quartic, and certainly not useful to us. (I have changed the vertical scale for this next graph).

We don’t get a smooth curve joining the 5 points.

**NOTE 2: ** You can also use Microsoft Excel to find a polynomial for you as well. (See the bottom of the DJIA Graph page for the procedure).

So I printed out my curves on paper, and cut them out. The 4 shapes were like this:

And the final mockup (using paper):

Yes, it’s rough, but the joins appear to be all good (within the mm or so tolerance of my cutting and sticking…)

So one generic solution for the problem is a parabola:

f(x) = 0.03x^2 – 0.64x + 14

As a side note, this problem reminded me of the shapes of Singapore’s iconic Marina Bay Sands Hotel. (I live in Singapore).

[Image source]

John replied to my first solution giving more detailed specifications, as follows:

- The curves should actually be arcs of a circle (which was not apparent in the first picture John sent)
- The curved faces will be tangent to the top face of the range hood (that is, it will be vertical at the top of the curve)
- The curved face is not horizontal at the bottom. It stops before the arc becomes horizontal.

So we now have to figure out the equation of the joins for circular sides, when laid flat.

John also supplied some dimensions for a typical case. It will be 12 units high, and 9.37 units from the top join to the bottom join, in the horizontal direction, as follows:

The curve at O is vertical, and the arc is 12 units in the vertical direction from O. When we calculate the arc length *p*, we find it is:

This leads us to consider the following possible solutions which represent the curved side laid flat (and once again rotated by 90° for the reasons given above).

Of course, there are infinitely many possible curves passing through (0,0) and (16.4,9.37), but the curve needs to be horizontal at (0,0), so that when we turn it 90°, it will be vertical.

Which curve could it be? And, what is the equation of that curve? Remember, it has to fit exactly with the other curves that are at right angles to it, and give us a circular arc when joined.

After several failed experiments involving complicated attempts at projecting the curved surface onto a flat plane, I stepped back and observed the 3rd curve looks a lot like a parabola, and the other 2 looked like they weren’t going to give us a circular curved surface. The useful paper, Unwrapping Curves from Cylinders and Cones, was the deciding factor.

Assuming now it will be parabolic, and given that it needs to pass through (16.4, 9.37), we can simply use the general form of a parabola:

Then solve for *a* by substituting :

This gives us:

I’ve left it in fraction form so we can more easily see where the general formula comes from later.

I then graphed this from *x* = 0 to *x* = 16.4 (the arc length).

Based on the simple parabola, I cut out shapes as in the following.

Here is the resulting range hood model made from paper.

The height of the curved part is now 12 units (as required) and the distance from the bottom left point in the picture the the top of the curved join was just over 9 units, as required. (Of course, some tolerance is applied since we are working with paper.)

You can see when we view the model from the side that the curved edges are indeed circular arcs, and it’s vertical at the top of the arc.

John wanted a general solution for the curve.

If the radius of the circular arc is given by *r*, and point *K* is (*m,n*) then the arc length will be:

The required curve will be:

I’ll leave it as an exercise for the reader to prove we actually will get sides which are arcs of a circle when using a parabola. ^_^)

(1) Often the simplest answer is the best.

(2) The quadratic curve is very handy in math!

The post Range hood curved sides problem appeared first on squareCircleZ.

]]>Investigate the meaning of the z-table using this interactive graph.

The post New z-Table interactive graph appeared first on squareCircleZ.

]]>Normal Probability Distribution Graph Interactive

You can use this applet to investigate what the z-table values actually mean.

In statistics, when we plot the distribution of a measurement (say, the heights of people) we very often produce the familiar bell-shaped curve.

For example, the **mean** (average) height for males in the US is 175.5 cm and the **standard deviation** is 7.4 cm. When we plot the heights of US males, we get a bell-shaped (also known as Gaussian) curve. We know that around 68% of US males have heights between 171.1 cm (one standard deviation below the mean) and 182.9 cm (one standard deviation above the mean.

However, it is difficult to work out probabilities and proportions when the mean and standard deviations are different for each type of measurement.

The solution is to **standardize** the measurements which means we translate the mean to 0 and the standard deviation to 1. When we graph this resulting distribution, we get the **standard normal curve**. We can use a z-Table to find probabilities of certain events occurring. The z-Table tells us the area under the standard normal curve for particular values of interest, thus telling us the probability of an event.

The applet allows you to vary the mean and standard deviation, and upper and lower boundaries of the region of interest.

Here’s a screen shot:

You can also see the calculations for your particular values.

This math applet uses JSXGraph, jQuery and MathJax. It works on tablets, albeit a bit slow. One of the challenges when developing this was to make it as efficient as possible.

The link again: Normal Probability Distribution Graph Interactive

The post New z-Table interactive graph appeared first on squareCircleZ.

]]>