Questions tagged [geometry]
The geometry tag has no summary.
63 questions
0
votes
2
answers
428
views
How to translate points on a path relative to two other points?
I'm trying to make a curved line move relative to the movement of a straight line.
I'm thinking that I want the points on the curved line to keep their relative positions to the two points on the ...
-3
votes
1
answer
282
views
Why sort the points acc to y coordinates in closest point divide and conquer method?
The divide and conquer strategy for closest point problem sorts the points according to x coordinates so that the median could be found. But what does sorting the strip (strip array contains all the ...
-5
votes
3
answers
249
views
Algorithm to find if a square is removable from a group of squares without disconnection
I have a group of squares on a 2d grid, here's an example
I need an algorithm to find out whether we are able to remove a square while keeping the entire group connected. Below is an image where I ...
-2
votes
1
answer
3k
views
Algorithm to split a grid of squares into equally sized sections
I have a grid of squares, let's say 12x12.
I want to split this grid into equal sections of 8 squares, which is 18 total sections.
There is no requirement for sections being convex or compact, and ...
1
vote
0
answers
223
views
Rectangle packing / Bin packing with multiple frames
I have multiple rectangular frames, with different fixed heights. The width should be minimized and there is a maximum width. Then there are many different smaller rectangles. These should be packed ...
-3
votes
2
answers
2k
views
How can I calculate the radius of an arc given by a series of points
Given a series of points, I need to assert that the plotted points form an arc (with a certain level of confidence), and I need to approximate the radius of the arc.
For example, the following points ...
1
vote
1
answer
532
views
What is a good Object-Oriented design for geometry objects when building libraries dealing with geometry operations?
I am trying to design an object-oriented library to handle geometric calculations. However, I am trying to exaggerate on being "tightly" object-oriented and applying relevant "best practices". I know ...
1
vote
4
answers
994
views
Algorithm to simplify 2D convex hull at the cost of extra area
Are there any algorithms related to the following problem that could be usefull for solving it?
I have a convex hull built on some point set.
I would like to simplify it (reduce number of points) by ...
5
votes
4
answers
342
views
Which class should have the `intersects` method?
I have a Circle class and a LineSegment class, and I want to implement a method that returns two points (or one, or none) for the intersections.
How do I know which class to put this method in? Would ...
2
votes
1
answer
86
views
Should a LineSegment class disallow approximately equal endpoints in its constructor?
Imagine a LineSegment class that represents a line segment using two arbitrary endpoints.
Should the constructor throw if it is passed two approximately equal endpoints? Obviously this would require ...
1
vote
3
answers
348
views
How do you usually implement right triangles in programming
When I want to implement axis aligned 2d rectangles I always go with {x, y, w, h}, because that is the natural approach to it. With 3d axis aligned rectangles you need {x, y, z, w, h, d(depth)}. For a ...
12
votes
5
answers
928
views
Find nearest best fit for circle
Below is an example image, if I have a point of the white dot in the middle and I want to find the nearest possible location for the blue circle (which is obviously at the location where I placed it) ...
1
vote
2
answers
342
views
How to detect thin extrusions from a polygon?
I want to create a minimal polygon which approximates the boundary of an arbitrary (semi-random) shape.
By "minimal" I mean, "as few points as possible".
The original shape (to be bounded) is in ...
1
vote
0
answers
70
views
Check if a point is deviating from a path made by a set of line segments
I'd like to know or have other ideas --other than my solution-- about how to check if a car on a given position (lat, lng) is getting away (let's say a distance D away) from the path where the car ...
0
votes
1
answer
2k
views
Calculate largest square in rectangle with a given vertex
There are two points (x1, y1) and (x2, y2), each of which can be any real integer pair. These define a rectangle R with vertices {(x1, y1), (x2, y2), (x1, y2), (x2, y1)}. The rectangle exists in a ...