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!
Who Dat?
Posted in General | Tags: New Orleans, Superbowl
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 in Tennis | Tags: Australian Open, Federer, Murray
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.
Comments Off
Posted in Flash, Math | Tags: Actionscript, Flash, Math, trigonometry
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.
Comments Off
Posted in Math | Tags: equations, linear equations, Math
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.
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
Comments Off
Posted in General
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.
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 in Flash, Math | Tags: Actionscript, Flash, Geometry
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.
Comments Off
Posted in Tennis | Tags: EXO3, EXO3 Black, Prince, Tennis
Prince EXO3 Black Review Part 1
This is the first in a multi-part review of the Prince EXO3 Black. I’ve hit with this racquet four times with my standard stringbed of Pro Hurricane Tour 17 on the mains and VS Team Gut 17 on the crosses. I previously used an O3 Speedport Black, although have been hitting with the Black Team for many months while recovering from an arm injury. I’m still not back to 100% on the arm/shoulder, so I feel this is a good condition to report on any wear/stress caused by the new frame.
Here are the racquet specs, right off the frame
Head Size: 100 sq. in
Length: 27 in.
String Pattern: 16×19
Unstrung Weight: 10.8 oz
Unstrung Balance: 12.6 in
Swingweight: 295
Power Level: 975
Grip: Prince Resi Pro
Stiffness: 72 (from the internet)
Strung balance appears to be a few points head-light. Although the EXO3 Black clearly feels heavier than the O3 Black Team, the swingweight is such that it’s pretty easy to get the racquet to the ball. I do experience some timing issues and that’s just a matter of me getting used to the frame.
My style is all-court (1hb) and what I never do under any circumstances is stand several feet behind the baseline and trade mondo-topspin groundies with the young whippersnappers. I like to step up, take the ball on the rise, and hammer it back deep and hard. For that, you need a rock-solid frame and the EXO3 Black delivers with flying colors. I can’t describe how much I like the solid feel at impact. I can stand closer to the baseline and take half- or three-quarter swings at deep balls and pound them back with complete confidence. It was a bit hit-and-miss with the prior frame.
Speaking of feel and response, I got a dramatic upgrade on volleys. I never liked being at the net with the Speedport Black Team, despite the excellent maneuverability of the stick. With the EXO3 Black, I can’t wait to get there
Serves are a bit different. I’m taking more of a half-stroke motion, starting with the racquet raised in the air. The EXO3 Black needs a bit more work to generate the same service speed. However, I noticed that I hit my spots with more regularity. I suspect that the previous frame was more susceptible to slight twitches in forearm or wrist motion.
I was quite pleased with the arm-friendliness of the heavier, stiffer frame. As expected, stroke timing is a bit different. When balls are being hammered to you by a pro or a 4.5+ player, tiny fractions of a second really matter. The first two sessions, I noticed some slight soreness in the front of my shoulder near the chest. It faded pretty quickly. By the fourth session, I didn’t notice much at all. With the Speedport Black Team, I had a problem with the head-heavy frame and a responsive stringbed at lower tension. Even sweet-spot impacts at very low racquet speed (like a drop shot) had some perceptible low-frequency vibration (the type a damper does not inhibit). Nothing but solid feel from the EXO3 Black. I should note, however, with this particular hybrid string job at lower tension, I prefer the feel of the frame with the small EXO3 vibration damper that comes with the racquet.
Stock grip feels really good, although I’m not sweating much in the colder weather. For most racquets, I can’t wait to apply an overgrip.
I’ll post another review as soon as I have pics. I don’t own a digital camera, so I have to find someone to take the pics for me. I want to compare the EXO3 Black to the Speedport Black in the same pic.
Posted in Tennis | Tags: EXO3 Black, Prince, Tennis
Going Underground for a While
Just returned from a long business trip. I’ve started a new and pretty intense gig. I’m back to work with the Flex framework for the first time in two years and already doing Google Finance-style data visualizations. I’ll be extremely busy for the next two weeks and then go on vacation for two weeks. I might blog a bit during vacation, but don’t expect much of anything between now and the end of the year.
Thanks.
Comments Off
Posted in General







Subscribe