Calculating the Bounding Rectangle of a Circular Sector
Auto-discovered
Visit resource ↗Description
Calculating the Bounding Rectangle of a Circular Sector is a short technical post on asawicki.info on computing an axis-aligned bounding rectangle for a 2D circular sector, a shape the author first called a cone in gameplay prototypes.
It defines the sector by apex, normalized direction, half-angle, and radius, then gives a GLSL routine using the apex, two edge points, and optional axis-aligned circle extremes inside the sector. The write-up favors vector tests over atan2, notes segment and full-circle limits, and mentions a ShaderToy prototype plus a reader-suggested code tweak.
It targets intermediate programmers building 2D games or spatial queries who need tight AABBs for sector attacks, sprays, or spells. Basic vector math and short GLSL reading are assumed.
The page is free HTML with prose, parameters, and a complete CalcConeBoundingRect listing to copy. No login is required.
It is useful for a compact bounding query ahead of grid or quadtree lookups without ad hoc angle logic.