Measuring Attack Vectors of Ball-Handlers

As a point guard growing up, I found that driving with my dominant shooting hand would typically put my shooting hand away from the basket. And being undersized at the position (5’4″, 95 pound Sophomore) made life more difficult to shoot off the dribble. Instead, I developed my non-dominant hand, which gave me two options off the drive: force a defender onto my left hand, giving me open stop-and-pop looks; or have an attack angle going left on a defender. This ideology worked great for me as I managed to post strong numbers in games such as 22 points, 11 assists against Fon-du-Lac; 27 points, 5 assists against Edgewood; and 12 points, 8 assists against Verona… all teams with future NBA and NCAA Division I talent (Indiana Pacers, Auburn University, and UW-Madison; respectively). To this date, unfortunately, I still finish stronger with my left than my dominant right.

My experiences are not too dissimilar from players who managed to become premier talent. James Harden, for example, applies the same methodology of attack as a primarily right-handed ball handler while being a left-handed shooter. In the NBA, however, teams are more concerned with containing a player. That is, forcing a ball-handler into sophisticated defensive coverage with limited ability to score of assist. One such example is the development of BLUE defense, which forces ball-handlers away from the middle into sideline containment. Let’s debate such a strategy.

Discussing BLUE Defense: Left Wing Attack

When deciding to place a defensive strategy against a ball-handler, the goal in mind is to reduce their probability of scoring. Suppose that the ball is on the left wing with a screener coming from the top of the key. In standard position, the screener’s man may be sagging with the on-ball defender covering Harden’s dominant dribbling hand.


Harden has the basketball on the left wing, waiting for a screen from a top-of-the-key teammate. Should the defense run BLUE in this situation?

If the defense does not opt for BLUE defense, Harden will gain access towards the key with his dominant right hand. This immediately opens the possibility for a pick-and-roll game that will required to be blitzed on defense. Here, a blitz is the full rotation of a post defender into the two-nine and a drop from a perimeter defender to the nail. These are the situations where Eric GordonTrevor Ariza, or Lou Williams became the insurance policy on offense, setting for a three-point attempt; as the three combined for 21.4 attempts per game last season for a 35.05% conversion rate.


No BLUE defense ran and Harden gains a 2-on-1 advantage with the ability to crash the lane. Options are: drive to basket, work the pick-and-roll, kick out across court to beat help defense, or pull up for the three point attempt.

Now if the defense opts for BLUE defense, Harden is forced to attack the basket with his non-dominant driving hand. However, this is his dominant scoring hand and Harden will be squaring off with, usually,  a post defender who may not be as reactive to stop a pull-up mid-range jumper. The number of options for the Rockets reduce as Harden is unable to skip a pass over the defense or crash the lane. To compensate, the Rockets were able screen with a competent three-point shooting big man such as Ryan Anderson or a smaller, but effective, Sam Dekker. Note that Dekker is no longer in Houston, and this role may be filled with the addition of P.J. Tucker.

A similar compensation is that the Rockets can also run the Hammer screen to free up a perimeter scorer like Ariza or Gordon for an open look in the weak-side corner. This is primarily effective when a blitz defense occurs as two defensive players sag off their weak-side opponents to disrupt the direct attack on the basket.


Defense runs BLUE defense and rotates accordingly. Harden is pushed to his non-dominant hand. If screen is flipped, we have a 2-on-1 defensive breakdown. Otherwise pick-and-pop to Ryan Anderson, mid-range pull-up by Harden, or Hammer Screen to Trevor Ariza/Eric Gordon are primary options.

So the question become this: which way is Harden more comfortable attacking the basket? 

Assessing James Harden is Easy…

For players like James Harden, we can assess tendencies relatively easy. For the 2017 NBA season, Harden finished second in the league with 8,036 touches. With thousands of touches, we are able to obtain enough left-wing possessions to identify the preferred direction of movement from Harden. To do this, we first must identify a way to quantify movement of James Harden on the court.

Direction of Basket

First, we identify the location of a player when they first receive the basketball. This location, relative to the basket, will identify the direction for which a player is moving on offense. To be clear, it is a low probability event that a player attacks their opponent’s basket on offense. We can leave those instances for Nate Robinson.

In the NBA a basket is located at center of the baseline and 5.25 feet from the baseline. This give us the two coordinates (5.25, 25) and (88.75, 25) for both baskets. Since we are operating on the left side of the court and the origin is located in the lower left-hand corner, our basket location is (5.25, 25). Using this location, we are able to build the direction to the basket with a simple vector calculation.

Suppose that Harden’s position with the basketball is (x_1, y_1). Then the direction to the basket is simply

Screen Shot 2017-10-02 at 12.03.26 PM


The direction to basket vector (turquoise) is a simple vector to calculate.


Direction of Attack – Thought Process.

The direction of attack is seemingly simple at this point. We just ask which side of the line the player dribbled. However, this is not such a simple calculation. For instance, if Harden goes right, we know that the y-axis in increases. However, so does the y-axis is Harden drives to his left with a tight attack vector. This means that we cannot simply just select points and “ask which side of the line Harden went on.”

If we performed a rudimentary analysis, we can sample points along the direction to the basket vector and compute several differences to find an offset that corresponds to right or left movement. This is completely inefficient.

Similarly, if we compute dot-products as we do in determining angles between players, this will give us only the angle and not relative direction of the angle of attack. To be complete, a dot product will tell us Harden attacked at say 10 degrees, but not 10 degrees left or 10 degrees right. So how do we identify this?

Rotation Matrices

A rotation matrix turns out to be very useful in this situation. In this case, we can turn every touch of a player into the exact same direction. To do this, we first calculate the direction to the basket, d. Next, we rotate the direction to the basket to the y-axis. This will allow us to identify all right hand movements as positive movements, while all left hand movements become negative movements.

For two dimensions, rotations are performed by using matrix multiplication. If you are unfamiliar with matrix multiplication, here’s a quick primer:

Matrix Multiplication

A matrix is merely composition of linear functions. Suppose our functions are from two-dimensional space to two-dimensional space. For our example, consider the functions F and G:

Screen Shot 2017-10-02 at 12.31.17 PM

Two linear functions that take in a 2-dimensional point and spits out a 2-dimensional point.

We can represent these two functions as matrices! But first, let’s do the actual composition of functions, where we apply the function F first and the function G second.

Screen Shot 2017-10-02 at 12.39.55 PM.png

Ugly, ugly composition of functions.

We see that the coefficients are merely certain mixtures of the coefficients of the functions F and G. These mixtures? This is exactly what matrix multiplication captures! Let’s see this:

Screen Shot 2017-10-02 at 12.45.48 PM

Matrix multiplication captures the composition of linear functions!

Back to Rotation Matrices…

With matrix multiplication at hand, we can simply look for compositions that help us rotate the vectors of interest. In this case, we wish to rotate the direction to the basket, d, to the y-axis. This will easily allow us to capture right and left movement of a player with the basketball. The classic rotation matrix is given by

Screen Shot 2017-10-02 at 2.59.30 PM.png

Rotation matrix given an angle, theta.

Here, we must find the angle of rotation between the current vector, d, and the desired vector, y-axis. This is simply, calculating the dot product between these two vectors! Since one is the y-axis, this becomes really simple:

Screen Shot 2017-10-02 at 3.03.22 PM.png

Note that y is the vector (0,1) as it is the y-axis only. This means that it’s length, ||y||, is 1. This means our equation drastically reduces to

Screen Shot 2017-10-02 at 3.06.53 PM.png

This doesn’t look simpler, but it is.

The calculation does not look simpler, but let’s break this down. The denominator is the distance to the basket. The numerator is the y-coordinate of Harden’s location relative to the basket. This is merely a computation we most likely will already hold and one that requires looking at one value already collected.


Identification of the theta rotation and the y-axis included. All that’s left is the rotation computation.

In our calculation, Harden is located at (24.4216, 8.7156) on the court. Let’s call this h for James Harden’s position on the court. To compute the rotation angle, we note that Harden is merely 25.1541 feet from the basket. This gives us a theta of 0.8666, or 49.6553 degrees!

In this case, we

Screen Shot 2017-10-02 at 3.42.02 PM

Calculation of the rotation matrix with respect to the direction to basket. We indeed get the y-axis with the distance to basket as the y-coordinate!

While we verified we had the correct rotation, all we need to do is measure attack angles are the following is to look at the next sequence of movements for Harden.


Building the Attack Vector

James Harden’s attack vector is not only the angle of attack, but also which direction Harden is attacking the basket. Let’s consider Harden’s subsequent movement. Suppose Harden goes right. To be clear of some numerical errors, let’s take his next .25 seconds of movement (six measurements in SportVU data) and average them. In this case, suppose this value is (19.8137, 9.7859). Let’s call this position, h2, for James Harden. In this case, did Harden move left or right?

To understand the movement, we subtract the initial point, (24.4216, 8.7156) to obtain (-4.6078, 1.0703). This is relative change in position of Harden with respect to his starting point. Applying the rotation matrix to this offset, we obtain (-2.1673, 4.2048). What does this mean?

Understanding the Rotation

Using the rotation, the direction to the basket becomes a vertical vector. This means anything to the left is a left hand drive; anything to the right is a right hand drive. Therefore all we need to look at is the sign of the x-value. In this case, the x-value is -2.1673. We don’t care about the number. The sign is negative, meaning that Harden went left.

Extracting Attack angle

Now that we know Harden attacked going to his left, we can now identify the attack angle associated with the left hand movement.

In this case, we only need to perform a dot product once again. This time, we use the vector d, as the initial vector and the vector h2 – h, which is the movement of Harden on the court. In this case, we obtain an attack angle of 27.2676 degrees to the left.

Screen Shot 2017-10-02 at 4.00.40 PM

Attack angle computation.



Movement of James Harden (red line) with respect to his relative position to the basket (turquoise line) in an effort to identify direction to the left (found by rotation) and his attack angle, alpha.

Quick Note: Identifiability

Note, we could do this with the x-axis instead of the y-axis as well. In this case, the idea is the same. The only catch we need to be sure of is that the rotation matrices move clockwise. In the y-axis case, this poses no problems until the ball is behind the basket. In this cases, we only check x_1 < 5.25. If this is indeed the case, we simply perform a theta = 360 – theta computation.

Utilization for Testing

Finally, we identify the fact that understanding attack vectors is only a small part of the analytic framework. In reality, we are more interested in what this metric brings us. Sure, it’s interesting to be able to calculate Harden’s characteristics. However, there is no edge to be gained unless we are able to leverage these metrics to identify actionable intelligence.

One such test may be the following: Suppose Houston’s opponents ICE’s the high screen. How likely is Harden going to score on this play?

Notice there is not a single question about going left here.

Instead, we focus on breaking out features to help us understand. Remember my story at the beginning? This had nothing to do to show you how I was as a basketball player. Instead, it was to give insight into my tendencies. If I drove left, my probability of scoring went up enormously compared to my right. Here, we now have a way of measuring if Harden goes left or right, as well as extracting how far left or right he drives with respect to the basket.

We can use these variables to set up an experimental design to help us understand the result of all plays where Harden drove in a certain direction.

Remember… Harden is simple…

Recall that James Harden is considered a simple case as he has several thousand observations of movement. Therefore, we can develop a model with ease. But what about all players?

In these cases, we may not have enough data to build a simple model. Instead, we may have to resort to random effects models with dimensionality reduction such as latent factor decomposition in effort to use the handful of observations to turn the data into meaningful intelligence.

In these cases, obtaining several features may be helpful for the reduction process. However, the method, here’s yet another way to extract spatial information in a game by only having to make less than ten computations.


2 thoughts on “Measuring Attack Vectors of Ball-Handlers

  1. Pingback: Measuring Attack Vectors of Ball-Handlers — Squared Statistics: Understanding Basketball Analytics | Advance Pro Basketball

  2. We providing NBA Daily Fantasy Sports Advice & Strategy, how to play fantasy basketball, Fantasy Basketball 101 Tips. To know about full NBA Fantasy Advice & Strategy from fantasybasketball101 site.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s