Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce number of transform invocations in area calc
When calculating an area with a transformation, we only really have to transform each point exactly once. However, the previous implementation was naively calculating each transformation twice. For simple transformations, this may not matter much. However, the transformation is user-supplied, so could be arbitrarily expensive to compute. The bounds of the for loop in the shoelace formula implementation have been reduced by 1 from from `[0, n)` to `[0, n-1)`. This is because the shoelace formula applies to rings, and the start and end points of rings are always the same. So the final iteration in the previous implementation was redundant.
- Loading branch information