REPOSITORY CODING · HARD
Centroids use signed cross-product moments divided by three times the double area; degenerate point/segment intersections have no area centroid
Centroids use signed cross-product moments divided by three times the double area; degenerate point/segment intersections have no area centroid. Trace the native model, algorithm services, repository snapshot and HTTP preview. Repair the incident while preserving the other contracts. All explicit fixtures and mandatory regression groups are available with bash test/run.sh.
convex-geometryExact convex clipping laboratory
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
C++ · 85 minute session
- Construct a strict counterclockwise convex hull, removing duplicate and interior collinear boundary points.
- Intersect clipping lines using the exact signed-distance fraction from the segment start, preserving rational vertices.
- Polygon area is one half the absolute shoelace sum, including rational intersections.
- Centroids use signed cross-product moments divided by three times the double area; degenerate point/segment intersections have no area centroid.
- Coverage includes polygon boundaries and degenerate segments, and reported diameter is the maximum squared Euclidean distance.
- Each input is a point cloud of at most twelve integer points in minus twenty through twenty. Both clouds become convex hulls; the clipper must have positive area. Intersections and metrics use bounded exact rational arithmetic, with no raster approximation.