This article is another reproduction of Carson Sievert. On April 2nd, 2013 Yu Darvish flirted with pitching perfection. To demonstrate his ability to deceive batters with a consistent delivery over different pitch types, redditor DShep created this gif, which layers video of five different pitches thrown by Darvish on April 24th:

http://i.minus.com/i3SXAH4AAxtWS.gif

Cool, huh? Well, I will show you how to ‘recreate’ a similar ‘gif’ with publicly available PITCHf/x data using the pitchRx R package. First, we collect all the pitches thrown by Darvish to Albert Pujols on April 24th:

library(animation)
library(pitchRx)
dat <- scrape(start = "2013-04-24", end = "2013-04-24")
atbats <- subset(dat$atbat, pitcher_name == "Yu Darvish" & batter_name == 
  "Albert Pujols")
pitches <- plyr::join(atbats, dat$pitch, by = c("num", "url"), type = "inner")

Lets animate these pitches using animateFX. Note that we take a different perspective from above by imagining the pitches coming closer as time progresses.

animateFX(pitches)

One thing to notice here is the different release points by Darvish (especially for his slider). Furthermore, Darvish didn’t even throw a curveball to Pujols. If you look closer at the original gif, you can actually see a different batter (than Pujols) in the batter’s box (look for a white bat). Darvish’s delivery looks very similar on videotape, but his arm angle (and thus) release point might be slightly different for different pitch types according to the PITCHf/x data. Let’s take a closer look at Darvish’s release point during this start.

atbats <- subset(dat$atbat, pitcher_name == "Yu Darvish")
Darvish <- plyr::join(atbats, dat$pitch, by = c("num", "url"), type = "inner")
qplot(data = Darvish, x = as.numeric(x0), y = as.numeric(z0), color = pitch_type) + 
  coord_equal()

plot of chunk release

As you can see, Darvish has quite different release points according to pitch type. For example, his slider tends to be more ‘side-arm’ compared to his four-seam fastball. Now, whether that difference is distinguishable to the human-eye is another question…

EDIT: Thanks to a recommendation by @Sky_Kalman, normalizing release points should make it easier to make visual comparison of flight paths across the pitch types. Here is one way to go about that:

pitches$x0 <- mean(as.numeric(pitches$x0))
pitches$z0 <- mean(as.numeric(pitches$z0))
animateFX(pitches)

Lastly, just for fun, let’s take an interactive look at Darvish’s pitches to Pujols. If your browser has WebGL enabled, go ahead and play with the object below!

library(rgl)
interactiveFX(pitches)

I think it would be awesome to have a similar tool in pitchRx for creating ‘gifs’ with actual video. If anybody has ideas on how we can connect PITCHf/x data with actual video, please contact me or leave a comment!

References



Published

15 May 2014

Tags