Two arrows on a flat floor, each a list [across, up]. The direction marks a line through the start; light falls on it at a right angle, so every point of arrow drops straight onto that line. Write shadow(arrow, direction): how far the arrow’s shadow reaches along the direction. A shadow that falls backward, against the direction, counts as negative.
An arrow 3 across and 4 up, and a direction along the floor’s edge. Light falls onto the direction’s line at a right angle. How far along the line does the shadow reach?
shadow(arrow, direction)| arrow | [across, up], e.g. [3, 4] and [1, 0] | e.g. [3, 0] |
| direction | [across, up], e.g. [3, 4] and [1, 0] | e.g. [1, 0] |
| returns | how far the arrow's shadow reaches along the direction | |