Vector math question

I have a player that needs to test a pass to see if it can be intercepted by an opponent. I don’t want to turn the player to face the receiver as I am only testing the pass. So I get a vector pointing from the player to the receiver:
Vector3 toTarget = target.position - transform.position;

First I want to make sure that the receiver is in front of the player. Next I want to compare the distance from the Player to the Intercept Point to the distance from the Opponent to the Intercept Point. See attached a diagram.

To test the pass, you need to know the speed of the pass, as well as the speed of the opponent.

The point of interception can be determined by projecting the opponent’s relative position onto your passing vector:

Vector3 toOpponent = opponent.position - transform.position;
Vector3 toTarget = target.position - transform.position;

Vector3 playerToInterception = Vector3.Project(toOpponent, toTarget);
Vector3 opponentToInterception = playerToInterception - toOpponent;

Then, compare distances with speeds to determine which will arrive first:

// Time to interceptionPoint for opponent and for pass
float opponentTime = opponentToInterception.magnitude / opponentSpeed;
float passTime = playerToInterception.magnitude / passSpeed;
if(opponentTime < passTime)
{
	// Pass will be intercepted
}

What happens if you divide by zero? Well, hopefully you won’t, because then your opponent or pass aren’t moving and will never reach their destinations. You can put a safety in to check for division by zero if you’re worried, but as long as a passSpeed and opponentSpeed are defined (and positive), that shouldn’t be an issue.