To implement Boolean operations we have to use elementary geometry algorithms (intersection of straight lines, distance between points etc).
Proposed solution
We can implement a module with elementary geometry algorithms.
module Primitives
module Elementary
def distance_points(p1, p2)
# Your implementation goes here...
end
# Other algorithms implementation goes here...
def intersect_straight_lines(straight_line1, straight_line2)
# Your implementation goes here...
end
end
end
Description
To implement Boolean operations we have to use elementary geometry algorithms (intersection of straight lines, distance between points etc).
Proposed solution
We can implement a module with elementary geometry algorithms.
Alternatives considered
You can suggest your own implementation.