Use Cases and Requirements
UC-1: Finding x-y coordinates of a point for sonification of a chart
An author wishes to detect the x or y value of each point along a given path or polyline representing a line chart, so the value can used as input to the Web Audio API as the pitch value on an oscillator, to present an audio rendering of that value, for accessibility, use in visually-challenging environments, user-experience enhancement, and so on. The coordinates should be accessed the same way no matter what the type or combination of segments comprise the path (e.g. cubic or quadratic beziers, lineto, horizontal, vertical, etc.).
UC-2: Collision detection for games
An author wishes to detect when 2 or more shapes touch, to allow sprites to affect each other (e.g. for hitting targets, grabbing objects, etc.).
R1: Intersection of shapes
Related: UC-1, UC-2
- For any 2 given shapes s1 and s2, provide an array of all points where the intersection occurs. If no intersections occur, return an empty array (or null?).
- For any given shape s, find all shapes whose stroke intersects with the stroke of s, and provide an array of all points where the intersections occur. If no intersections occur, return an empty array (or null?).