Code Golf Simulated Golf Given a list of hole yardages, green sizes, a slice angle and a max distance, compute a golf score.

Assumptions


Earth is flat
All greens are circular
Slice angle will be between -45 and 45 degrees and will be given in degrees
All distances in the same metric (yards or meters, doesn't matter)
No out of bounds, obstructions or doglegs
Max score on any hole is 8
All shots travel the lesser of max distance or distance to the hole, in a direction defined by the angle to the hole plus the slice angle.
Distance is measured as the straight line or Euclidean distance between the start and end point.
Max distance and slice angle are the same for all shots on all holes
The golfer always two-putts once on the green (or exactly on the edge of the green).


Example

Let's look at the hacker from the test case #5 below for hole #2.  The hacker can hit the ball 320 yards, but always slices 30 degrees.  If we assume without loss of generality that the tee box is at {0,0} and the green is at {497,0}, then he will hit shots to the following points, arriving on the green with the 7th shot:

{{0.,0.},{277.128,-160.},{547.543,-131.372},{569.457,7.67088},{502.872,37.2564},{479.159,7.92741},{490.646,-7.85868},{500.078,-4.22987}}

At this point, his score would be 9 due to the two putts required, so the final score for him gets capped at 8, per the assumptions.

Graphically, it will look like this:


Test Cases

All the test cases have standard 18-hole courses

Case#1
{MaxDistance-&gt;280,SliceAngle-&gt;10,HoleDistances-&gt;{181,368,161,416,158,526,377,427,509,148,405,443,510,494,396,388,483,172},GreenDiameters-&gt;{26,18,17,23,27,23,21,23,25,21,19,24,21,23,25,24,22,22}}
Scores: 
{4,5,4,5,4,5,5,5,5,4,5,5,5,5,5,5,5,4}
Output: 85

Case#2 (same course as Test Case #1, shorter more accurate golfer)
{MaxDistance-&gt;180,SliceAngle-&gt;5,HoleDistances-&gt;{181,368,161,416,158,526,377,427,509,148,405,443,510,494,396,388,483,172},GreenDiameters-&gt;{26,18,17,23,27,23,21,23,25,21,19,24,21,23,25,24,22,22}}
Scores:
{4,5,4,5,4,6,5,5,6,4,5,5,6,6,5,5,5,4}
Output: 89

Case#3 (Same golfer as test case #1, shorter course)
{MaxDistance-&gt;280,SliceAngle-&gt;10,HoleDistances-&gt;{147,497,110,528,409,118,196,154,134,514,374,491,131,138,523,478,481,494},GreenDiameters-&gt;{32,16,36,25,32,20,30,30,33,29,25,26,26,25,33,28,21,28}}
Scores:
{4,5,4,5,5,4,4,4,4,5,5,5,4,4,5,5,5,5}
Output: 82

Case#4 (Same course as test case #3)
{MaxDistance-&gt;180,SliceAngle-&gt;5,HoleDistances-&gt;{147,497,110,528,409,118,196,154,134,514,374,491,131,138,523,478,481,494},GreenDiameters-&gt;{32,16,36,25,32,20,30,30,33,29,25,26,26,25,33,28,21,28}}
Scores:
{3,6,3,6,5,4,4,3,3,5,5,5,3,3,5,5,6,5}
Output: 79

Case#5 (Hacker)
{MaxDistance-&gt;320,SliceAngle-&gt;30,HoleDistances-&gt;{147,497,110,528,409,118,196,154,134,514,374,491,131,138,523,478,481,494},GreenDiameters-&gt;{32,16,36,25,32,20,30,30,33,29,25,26,26,25,33,28,21,28}}
Scores:
{6,8,5,8,7,6,6,6,6,8,8,8,6,6,8,8,8,8}
Output: 126


Rules


Any format can be used for the input. Output is simply the number of simulated strokes, so should be an integer.
This is code-golf so the shortest answer in bytes wins.  Standard loopholes apply.
JavaScript (ES7), 128 126 bytes

(m,a,D,S,t=0)=&gt;S.map((s,i)=&gt;t+=(r=(f=d=&gt;d&gt;s/2?1+f((l=d&lt;m?d:m,l*l+d*d-2*d*l*Math.cos(a*Math.PI/180))**.5,s):2)(D[i]))&lt;8?r:8)&amp;&amp;t


Try it online!

Explanation

Because only the distance from the ball to the hole matters and not the coordinates of the ball, we can write an algorithm that calculates how close the ball gets to the hole with each shot, then run that repeatedly until the ball reaches the green. But how do we do this?

Re-using OP's helpful diagram explaining ball movement, with MS Paint modifications:



We have access to these numbers:


d, the current distance from ball to hole;
θ, the slice angle; and
l, the length of the shot (minimum of d and the max shot length).


And the goal is to find x, the distance from ball to hole after the shot is taken.

First we note that a and b are simply l cos θ and l sin θ, respectively. We can see that by the Pythagorean theorem, x can be represented as sqrt(b2 + (d-a)2). Expanding this out, we get

x = sqrt(b^2 + (d - a)^2)
  = sqrt((l*sin(θ))^2 + (d - l*cos(θ))^2)
  = sqrt((l^2 * sin^2(θ)) + (d^2 - 2*d*l*cos(θ) + l^2 * cos^2(θ))
  = sqrt(l^2 * sin^2(θ) + l^2 * cos^2(θ) + d^2 - 2dl*cos(θ))
  = sqrt(l^2 * (sin^2(θ) + cos^2(θ)) + d^2 - 2dl*cos(θ))
  = sqrt(l^2 * 1 + d^2 - 2dl*cos(θ))
  = sqrt(l^2 + d^2 - 2dl*cos(θ))


And so, the new distance from ball to hole will be sqrt(l2 + d2 - 2dl cos θ). Then we count the iterations it takes to get this distance within the radius of the green, add 2, and cap at 8 to get the final score for that hole.

(Thanks to @LegionMammal978 for pointing out that all of the calculations I made are a direct result of the law of cosines...)



Interestingly enough, when the ball is closer to the hole than its max shot, l = d and we can simplify the formula quite a bit further:

x = sqrt(l^2 + d^2 - 2dl*cos(θ))
  = sqrt(d^2 + d^2 - 2d^2*cos(θ))
  = sqrt(2d^2 - 2d^2*cos(θ))
  = sqrt(d^2(2 - 2cos(θ)))
  = d * sqrt(2 - 2cos(θ))


To find the # of remaining iterations, we could then simply find d / r (where r = the radius of the green) and divide that by sqrt(2 - 2cos(θ)), then take the ceiling of the result and add 2. Unfortunately, this doesn't seem to be as short as just finding the smaller of d and the max shot length.