Repository navigation
Document the last undocumented functions of trapezoid and simplification - #143
Merged
Merged
Conversation
compute_top_right_shift is documented like compute_right_shift, whose move it generalizes to a direction of slope 'a': it returns by how much the x of the generalized trapezoid must increase, moving along this direction, for it to be right next to the other one. GeneralizedTrapezoid ::to_svg and simplify_export_inputs are documented too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GeneralizedTrapezoid::compute_top_right_shift,GeneralizedTrapezoid::to_svgandsimplify_export_inputswere the last public functions of the library without documentation.Change
compute_top_right_shift: documented ascompute_right_shiftalong the direction of slopea, towards increasing x: it returns by how much the x of the trapezoid must increase (its y increasing byatimes as much) for it to be right next to the other one, i.e. the largest shift at which a vertex of one of them meets a side of the other; 0 if there is none.amust be non-zero.to_svg: y-axis going up, coordinates multiplied byfactor, filled withcolor.simplify_export_inputs: writes the inputs ofsimplifyto a JSON file.The contract of
compute_top_right_shiftis inferred from its code and fromGeneralizedTrapezoidComputeTopRightShiftTest(two rectangles side by side, moved along slope 1, touch at a corner after an x shift of 2); it isn't used elsewhere in the library.Tests
Comments only; the library builds and the trapezoid and simplification tests pass.