question: public static ArrayList < Coords > intervening ( Coords src , Coords dest , boolean split ) { IdealHex iSrc = IdealHex . get ( src ) ; IdealHex iDest = IdealHex . get ( dest ) ; int [ ] directions = new int [ 3 ] ; int centerDirection = src . direction ( dest ) ; if ( split ) { centerDirection = ( int ) Math . round ( src . radian ( dest ) + 0.0001 / HEXSIDE ) % 6 ; } directions [ 2 ] = centerDirection ; directions [ 1 ] = ( centerDirection + 5 ) % 6 ; directions [ 0 ] = ( centerDirection + 1 ) % 6 ; ArrayList < Coords > hexes = new ArrayList < > ( ) ; Coords current = src ; hexes . add ( current ) ; while ( ! dest . equals ( current ) ) { current = Coords . nextHex ( current , iSrc , iDest , directions ) ; hexes . add ( current ) ; } return hexes ; }
target:  Returns an array of the Coords of hexes that are crossed by a straight line from the center of src to the center of dest, including src & dest. The returned coordinates are in line order, and if the line passes directly between two hexes, it returns them both. Based on the degree of the angle, the next hex is going to be one of three hexes. We check those three hexes, sides first, add the first one that intersects and continue from there. Based off of some of the formulas at Amit's game programming site. (http://www-cs-students.stanford.edu/~amitp/gameprog.html) Note: this function can return Coordinates that are not on the board.