Hans Van Slooten

Sports, Technology, and Analytics. Not necessarily in that order.

Normalizing PITCHf/x Release Point Data

PITCHf/x release points are generally recorded at 50 feet. I say generally, because in the early years (2007-2009) they varied from 40-55 feet while they were trying to determine the best location. In late 2010, Mike Fast published an article arguing that 55 feet is more representative of true pitcher release points (every pitcher is a bit different in reality). Since then, it has become standard practice to renormalize all pitches to 55 feet to make analysis more consistent. The procedure to do this, while alluded to by Alan Nathan, is never really spelled out explicitly. That is what I aim to do here.

The procedure is fairly straightforward (and hence probably why it isn’t normally shown). The equations for the position of the ball at time t are (remember high school physics?):

The equations for the velocity of the ball at time t are the first derivative of the position, so:

Where is the release point as reported by PITCHf/x, is the initial velocity at that release point, and is the acceleration.

First, you need to calculate time t for when the ball was at 55 feet. Using the quadratic equation, you can derive t:

Now, using the equations above, you can calculate position and velocity at y = 55 feet.

Finally, to recalculate start_speed:

PITCHf/x Processing Scripts

I’ve uploaded some (very) rough perl scripts for processing PITCHf/x data to Bitbucket. These can retrieve the data, create the database, and store the data to the database (I know, surprising). They’re not configurable, yet (you have to modify the code to determine what to download). Anyway, I hope to clean up the code in the near future, barring other projects.

https://bitbucket.org/mncoder/pitchfx

Remapping Caps Lock to Control in Windows

Years ago – before the creation of Sublime Text – I regularly used Emacs for editing (yes, even on Windows). For anyone who has any familiarity with Emacs, they know that you use the Control key like breathing air. Unfortunately, most keyboards were designed like the Control key was meant for the occasional tap, not continuous usage.

"The Control Key is in a bad place"

Because of this, I learned that you could remap the Caps Lock key to Left Control to make it more readily available to my RSI plagued hands. Invariably, though, I would have to search the web for the correct registry incantation to invoke this change. Tiring of this, I’ve decided to simply host the solution on this blog. What follows is the necessary changes, as well as an brief explanation of how this works.

Monospaced Developer Fonts

I’ve dabbled in creating monospaced fonts primarily for programming purposes. Here are the results.

VGAToo

VGAToo is a Windows bitmap font that can be used in a console window. It’s based on the standard VGA text font.

Download VGAToo Font

ProFontBold

ProFontBold is simply a modification of the True Type ProFont provided here. It was missing the bold version which tends to be useful, so I added it.

Download the ProFontBold Font

Building an ASP.NET MVC Site in F#

With the introduction of Microsoft Visual Studio 2010, F# has become a first-class citizen of the .NET world. Well, that’s the theory anyway. While I appreciate the work that Microsoft has done to make functional programming more accessible to the wider development community, F# is still not quite on equal footing with languages like C# and VB.NET. This is to be expected, as it is still a very new language, and I have no doubt that Microsoft will continue to improve support for F# in the .NET ecosystem.

That said, one of the most exciting areas in the .NET world these days is the introduction of ASP.NET MVC over the past year or so. While the open source world has had many options for the MVC development pattern in web applications (Ruby on Rails, Django, etc.), the .NET world has not had as many options. ASP.NET MVC has changed that and allows developers in the .NET world to develop web applications in a much more natural and testable way than the traditional WebForm model.