Posted by: algorithmist | March 2, 2010

More Indoor Tennis in D/FW Area

Do you play tennis in the D/FW area and live relatively close to the airport? Bummed out by the bad weather this winter? Well, the Hilton D/FW Lakes has the solution for you. They have reopened indoor courts. The court area alternates between meeting space and tennis, so it’s important to check ahead for availability and make a reservation.

Rates are very reasonable for indoor courts, $15/hour for sports club members and $20/hour for non-members. I’ll post some pics or video whenever possible. In the mean time, contact the sports club for more information at 817.481.8444.

Posted by: algorithmist | February 22, 2010

Black History Month Robert Walter Johnson

Over  the past two years, I profiled several black mathematicians, many of which had an indirect influence on my own career.  I’ve been very busy taking care of family issues as of late, so blogging has gone off my personal radar.  Even so, I recently realized I have yet to profile a single black contributor to the sport of tennis.

Modern players like Blake and Monfils capture the public eye with their incredible talent.  Who has not heard of the Williams sisters?  Some of us may even remember greats such as Arthur Ashe and Althea Gibson, the first male and female black winners at Wimbledon.  Whatever the Williams sisters achieve on the road of success, that road was paved by athletes such as Gibson.  In 1950, she was the first black woman to compete at the US Open. Gibson achieved the same status at Wimbledon in 1951.

But the history goes back even further than that.  Black tennis players have a godfather whose achievements paved the way for players like Gibson and Ashe.  Both these players were coached by Robert Walter Johnson.  Johnson was a physician by trade, but an intense tennis player.

Due to segregation, black tennis players in the South had no access to public courts and often little if any money for lessons.  Johnson established a tennis camp for African-American children where expenses and instructor fees were paid.  In some cases, blacks were denied access to hotels, so Johnson offered his house as lodging to distinguished African-Americans passing through the Lynchburg, VA area.

In 2002, the house and tennis court were added to the National Register of Historic Places and in 2007, Dr. Johnson was nominated for inclusion in the International Tennis Hall of Fame to which he was inducted in 2009.

While you enjoy the success of modern black players in the time, I hope you also make time to search the web for more on “Whirlwind” Johnson, the person on whom much of the foundation of black tennis can be firmly pinned.

Posted by: algorithmist | February 8, 2010

Who Dat?

Just a quick shout out to friends and business associates from N.O., including Chris Giordano (director of tennis and sports club at the Hilton D/FW Lakes).  Congratulations on the superbowl win!

Posted by: algorithmist | February 1, 2010

Aussie Open Wrapup

Well, this was a really good tournament.  On the mens side, I’m always pleased with a Federer win.  Last year, he seemed to be weighted down with the effort to match Sampras’ slam record.  Running into an inspired performance by Nadal, his serve broke down in the crucial fifth set.  This year, he seemed very relaxed and held off a strong challenge from Murray in the third set.  Some will say that the win did not come against Nadal, however, the hyper-physical style of play that lead to much of Nadal’s success has now come back to haunt him.  At  that level of physical intensity, the window of time to play at one’s absolute peak is very small.

Speaking of wear and tear, it seems like the grind of the tour has really caught up to Roddick.  I had higher hopes for him coming off the prior tournament win, but the two-week format of a major championship does not bode well for injuries, especially to your playing arm.

Also on the US mens side, I had hoped for slightly more depth from John Isner, but he ran headfirst into a strong performance from Murray, who seems well on his way to becoming the first Brit since Fred Perry to win a slam.  If Murray continues to improve at his current pace and remains fit, it’s truly only a matter of time.  I do believe he needs to learn how to adjust to a more aggressive level of play.  Had he come into the net more, it might have been a different final.  Federer was playing lights-out from the baseline, although he did not appear to be hitting passing shots all that well.  Murray was winning a very high percentage of points at the net when he did come in throughout the entire tournament.  When pressed, he seems to revert to his more comfortable role as a baseline counter-puncher.  Get beyond that and we should see several majors from Murray.

Congrats to the Bryan brothers on regaining the doubles championship.  Interesting move by their coach to switch court coverage for the brothers.  Seemed to work well, though, and the result speaks for itself.

Speaking of results, how about those Williams sisters!  When Serena serves the way she’s capable of, it’s pretty much a question of whether or not she will beat herself, not whether her opponent will beat her (unless someone on the women’s side every matches that serve).  Great performance by Venus to put the singles loss behind her and take the lead in an impressive doubles championship.

Great tournament to start a new year.

Posted by: algorithmist | January 8, 2010

Trigonometric Parameter Model

The question that generated this topic was very similar to a problem I worked on recently. It deals with the trend of the last few posts on creating simple models that fit data. Suppose we have a parameter, z. It does not make any difference what z is; it could be depth or some other value. Suppose an object moves along a path parameterized by some angle, Θ, in [0,2∏].  The maximum value of z is given as zmax. An additional parameter, α, is defined with α in [0,1]. This is used as a multiplier onto zmax to describe the fraction of that value that must be obtained at certain angles.

A model, f(Θ), is to be created that fits the following data.

f(0) = αzmax
f(∏/2) = 0
f(∏) = azmax
f(3∏/2) = zmax
f(2∏) = f(0)

The model is symmetric moving from 3∏/2 to ∏. The general tendency among programmers is to immediately jump to a linear model for any parameter. The person submitting this question had normalized the angle to [0,∏/2], then had a series of if-statements to determine the parameter value.  Next, the parameter value was modified again based on the quadrant containing the actual angle. The question was whether or not a more compact approach was possible.

The answer depends on whether we can find a base function that has the necessary values at the prescribed data points and behaves in a ‘reasonable’ manner as the angle varies across its domain.  In this case, I looked as the cosine function as a starting point.  The absolute value of this function is 1 at Θ = 0 and decreases to 0 at Θ = ∏/2 and then increases back to 1 as Θ increases to ∏.  It does so in a manner that was similar to the sequence of linear approximations modeled by the if-then-else blocks from the person submitting the problem.

A base model in [0,∏] might look like αzmax|cos Θ| .  Fortunately, as Θ moves from ∏ to 3∏/2, the increase in f to zmax can be modeled like a reflection about the horizontal axis. So, we can create a relatively compact model by

1 – normalize the input angle into [0,2∏) - note the open interval at the end
2 - compute p = αzmax|cos Θ|
3 - for Θ in [0,∏], f(Θ) = p, otherwise f(Θ) = zmax – p

Of course, like any other model, this one needs to be tested to see if the parameter values are reasonable for values of Θ other than the ones used to fit the model.  Usually, this is based on some aesthetic criteria.  I hope the exercise shows how to think about such problems in a manner other than breaking the input into a small range, using linear interpolation inside that range, then modifying the value based on quadrant.

Posted by: algorithmist | December 28, 2009

More on Simultaneous Equations

The previous post dealt with solving three equations in three unknowns, however, one equation was trivial leaving two equations in two unknowns. This problem is similar and my guess is that the person emailing it to me is trying to fit an equation to some data. So, I’ll solve the requested problem, then comment on its application.

The person submitting the problem wanted to find the coefficients of a cubic polynomial satisfying the following conditions. Let p(x) = a + bx + cx2 + dx3.

p(0) = 0
p(1/4) = ∏/2
p’(0) = m1
p’(1/4) = m2

Instead of fitting a cubic polynomial to four points, this person wants to find the polynomial interpolating two points with specified slope at those two values. Seems to me this should really be a cubic Hermite curve, but more on that later. At the least, it’s a good exercise in setting up and solving a system of equations.

Now, p’(x) = b + 2cx + 3dx2, so

p(0) = 0 means that a = 0. This makes things quite a bit easier ;)

p(1/4) = ∏/2 -> b/4 + c/16 + d/64 = ∏/2 or b/2 + c/8 + d/32 = ∏ or 16b + 4c + d = 32∏ .

p’(0) = m1 -> b = m1 . Fortunately, the easy initial conditions leave us with two equations in the remaining two unknowns c and d.

p’(1/4) = m2 -> m1 + c/2 + 3d/16 = m2 – m1 or 8c + 3d = 16(m2 – m1) .

Substitute the value of b into the equation for p(1/4) to obtain 4c + d = 16(2∏ – m1) = c1

Let c2 = 16(m2 – m1) = 8c + 3d. Solve the above equation for d and substitute into the second to yield

8c + 3(c1 – 4c) = c2 or 4c = c2 – 3c1 or c = (c2 – 3c1)/4 .

Since d = c1 – 4c, we have d = c1 – (c2 – 3c1) = 4c1 – c2 .

Given the coefficients, the polynomial can be evaluated efficiently in nested form.  I think the issue with these problems is getting overwhelmed with all the conditions.  Once you write it out and take it one step at a time, things become much easier, especially with the friendly conditions. It can often be easier to introduce additional temporary variables such as the c1 and c2 above instead of writing everything out in terms of initial variables and conditions.

My belief is that the person asking this question wanted to ‘fit’ a table of data with a cubic polynomial.  The conditions were designed to force the polynomial to take a certain direction ‘out of’ the initial point and ‘in to’ the final point.  The problem with polynomials of this form is that they want to oscillate.  The higher the degree, the greater the tendency to oscillate.  Just setting the derivative value at the endpoints does not guarantee the polynomial will follow that direction more closely as the derivative value increases.  That’s essentially what a cubic Hermite curve does.  The polynomial derived here may do a good job close to the endpoints, but don’t assume that means a good fit anywhere else.

In the previous post on parabolic scaling, we presumed that a quadratic polynomial was a reasonable model for the problem at hand.  I hope this post helps some people with setting up and solving simultaneous equations and provides some insight into the thinking process regarding whether or not such a polynomial is a good model for a given problem.

Posted by: algorithmist | December 21, 2009

Parabolic Scaling

This is a variation on a problem submitted to me recently.  I suspect the original question related to scaling an object moving in a circular, elliptical, or some other path parameterized on an angle that varies between zero and pi.  The scaling is applied in Actionscript and must satisfy the following criteria (Let S(θ) = scale factor at the angle, θ).

S(0) = 1/4

S(∏/2) = 3/4

S(∏) = 1

S(3∏/2) = 3/4

S(2∏) = 1/4

The question is how to derive a formula for the scaling that satisfies these conditions.  This is the opposite of a more common situation in which one is given a functional representation and required to derived the necessary function parameters.  In this case, we are given conditions but no direction on an appropriate functional representation.  In such a case, we are free to choose the function.  Actual choice may depend on aesthetic or other considerations.

First, notice the symmetry about pi.  The problem can be reduced to one of finding a functional representation of S(θ) in [0,∏] If the input angle is greater than ∏, we can use reflection to generate the angle that is input to the scale function.

For purposes of illustration, a polynomial representation for S is used.  Three conditions are provided in [0,∏], providing three degrees of freedom in selecting function parameters.  This allows a quadratic polynomial to be used to represent S, i.e.

S = a + bθ + cθ2

The three coefficients a, b, and c are determined from the three conditions

S(0) = 1/4

S(∏/2) = 3/4

S(∏) = 1

The first condition implies a = 1/4, leaving us with two equations in two unknowns,

1/4 + b(∏/2) + c(∏2/4) = 3/4

1/4 + b∏ + c∏2 = 1

I won’t crank through all the math here (if too many people have problems, I’ll post the complete derivation later).

The solution is b = 5/4∏ and c = -1/2∏2

In the code, the angle should be reduced to [0,2∏]. If the reduced angle is greater than ∏, reflect about ∏ to create the actual θ value to input to the formula

s = a + b*(θ + c*(θ))

which evaluates the polynomial in nested form. The parabolic representation of scale is only one possible solution to this problem. If the input scale factors vary, it is possible to use Cramer’s rule, for example, to dynamically solve for the necessary coefficients.

Posted by: algorithmist | December 18, 2009

I’m a MAC

Well, it’s official.  Last night, I brought home a new MBP, 17″ .  I’ll be loading up on software over the next month or two.  I’m moving today, so I’ll be offline for a couple days.  I might post some pics when I get the new office setup.

Yes, I’m a MAC :)

Posted by: algorithmist | December 1, 2009

Drawing Circular Segments in Actionscript

This problem, in a couple different variations, has been presented to me a few times over the past two months so I thought it might be worth a blog post.  The problem ranges from drawing an aribtrary circular segment to the more general fractional circular area problem.  Since the former is covered in the latter, the problem discussed here is how to dynamically draw a portion of a circle that represents some fraction of the circle’s area.  Refer to the following diagram.

Segment of a Circle

The green shaded area represents a segment of the circle with radius r.  The general problem is given some multiplier, α in [0,1] how do we draw the green region so that its area is αAc, where Ac is the area of the circle. If α is less than or equal to 1/2, the problem reduces to drawing a circular segment at or below the horizontal axis passing through the center. For larger multipliers, we can locate the A and B points corresponding to a segment from the ‘top’ of the circle at a multiplier 1- α , drawing the complement of that segment.

Once the points A and B are identified, the outline of the circle is drawn with a sequence of quadratic Beziers just as in a wedge-drawing program with a line from A to B to complete the drawing. The quad. Bezier code for this example was extracted from my Singularity Wedge class.

To start the Bezier drawing, we need a start and end angle. Given the central angle of the sector, Θ, the start and end angles follow immediately.  You can look up the area of the segment on the web and equate it to a multiplier of the circle’s area.  This yields the equation

Θ – sin Θ = 2∏a .

This is not directly solvable for the central angle.  If the constant term on the right is moved to the left side of the equation, then the problem reduces to finding a zero of a function.  Ah, a numerical analysis problem … just what I like :)   I like it even more that I’m about to move and was organizing some folders containing old NA notes and had some scribbling on a good starting value for Θ – sin Θ, namely the cubed root of the constant term with a small multiplier.  So, Newton’s method should converge pretty quickly.

A standard Netwon iteration is used with f(Θ) = Θ – sin Θ – 2∏a and f’(Θ) = 1 – cos Θ .  The computation of start and end angles corresponding to the A and B points as well as the quad. Bezier code to trace the relevant circle outline can be deconstructed from the example code.

The following diagram shows an example of a multiplier greater than 1/2.  In the demo code, the slider is moved to vary the multiplier from 0 to 1.

The code is all AS in Flash CS4.  No classes, just straight code on the timeline.  You can modify the code, repackage it into classes, do whatever you like.  Deconstruct and enjoy :)

Download .zip file of .FLA here.

As an aside, there is another approach to this problem that I like even better, but does not have the simple intro. to Newton’s method.  If time allows, I’ll blog about that one later.

good luck!

Posted by: algorithmist | November 19, 2009

Prince EXO3 Black Review Part 2

My recent two hitting sessions were against a heavy, cold wind.  I was quite pleased with how the frame held up against the wind.  Here are some pics of the racquet, courtesy of Tom Coyle (Hilton D/FW Lakes).  The EXO3 Black is shown by itself and compared right next to the O3 Speedport Black (both with the exact same string job).

EXO3 Black is on the right, Speedport Black on the left (with the blue grommets).  I have to keep the pic sizes small for the blog.  Contact me if you want the full-size images.

The racquet has the same 16×19 string pattern and head size as the O3 Black.

Here is a side view.

Yes, that’s me – sorry, we were going low-budget on this production :)

Now, here’s the frame straight on.

And last, the two side-by-side.  BTW, the EXO3 Black is shown with the stock grip; the O3 Speedport Black has an overgrip.

Sorry about the left hand over part of both frames, but it was *very* windy when these pics were taken, so it was pretty difficult to keep the two racquets steady for the camera.

Older Posts »

Categories