Questions tagged [computational-geometry]

is a branch of computer science devoted to the study of algorithms which can be stated in terms of geometry.

The computational-geometry tag should be assigned to questions about computation and manipulation of locations or properties of geometric identities or objects. Since geometry computations are highly tolerance dependent, definition and computation of tolerances are welcome, too. Sample Questions are: How to compute line-line intersection on 3D? What is the better way of handling geometrical identities as data structures? How to compute volume of a solid? How to deform a solid? How to obtain parametric solids or surfaces?

2743 questions
1
vote
1 answer

Find smallest circle with maximum density of points from a given set

Given the (lat, lon) coordinates of a group of n locations on the surface of the earth, find a (lat, lon) point c, and a value of r > 0 such that we maximize the density, d, of locations per square mile, say, in the surface area described and…
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
1
vote
1 answer

3d width and cross-sections

Greetings, We have a horn-shaped 3d body, which is represented as a list of vertices and faces. Each face is a triangle represented by 3 vertices. The body is positioned along the Z-axis (height). We would like to make several cuts at certain…
Ojala
  • 105
  • 1
  • 5
1
vote
1 answer

Tell if point belongs to ray in 3D space

I have this problem: verify if point belongs to ray in 3D. After some math research, I've coded the solution, but it seems that it just doesn't work. That's the illustration. P is the point. E - the end-point of ray. V - directional vector of the…
Monstryyy
  • 81
  • 9
1
vote
1 answer

find which tetrahedral element a point belongs to

I have a tetrahedral mesh of a 3d region. The mesh is defined by two files with extensions .node and .ele which contain data related to nodes and elements (this is the format of output files from tetgen, the 3d Delaunay tetrahedralization program).…
praveen kr
  • 115
  • 8
1
vote
1 answer

Sidereal time calculation in C

I have some code which I taken from Javascript. Original purpose of the program was to calculate Solar Radiation. It calculates Solar Position, Earth Distance from Sun, Hour Angle, Zenith, Azimuth etc. I tried to analize one part of the program…
John Boe
  • 3,501
  • 10
  • 37
  • 71
1
vote
0 answers

JS - How much an irregular polygon covers an area

INTRO I have an array of X/Y coordinates. This array generates an irregular polygon inside a square area of 128 x 128 pixels. So the value of the coordinates can be only a number from 0 to 127 (0,0 is the left top corner - 127,127 is the right…
1
vote
0 answers

Approximate Area with Grid-Aligned Rectangles

So we have some complicated shape A which we want to approximate with the union of up to N grid-aligned (x/y axis) rectangles, which we'll call B. For simplicity let's say A is rendered to a bitmap. This also means that rectangle corners will be on…
1
vote
1 answer

Tranforming a geometrical shape, keeping symmetry and bounding dimensions intact

I'm developing a tool for modifying different geometrical shapes from an assortment of templates. The shapes are basic ones that could be found in rooms. For example: L-shape, T-shape, Hexagon, Rectangle etc. What I need to do is making the shape…
1
vote
2 answers

Interpolating missing contour lines between existing contour lines

Contour lines (aka isolines) are curves that trace constant values across a 2D scalar field. For example, in a geographical map you might have contour lines to illustrate the elevation of the terrain by showing where the elevation is constant. In…
1
vote
2 answers

Polygon-polygon-intersection fails in special case

I have implemented the Bentley-Ottmann-algorithm to detect polygon-polygon intersections. This usually works very well: Since the polygons are not self-intersecting any line-segment intersection in the union of the line-segments of both polygons…
user2033412
  • 1,950
  • 2
  • 27
  • 47
1
vote
1 answer

Geometry Arc Algorithm

I searched all internet and didn't find any pseudo code that solved this problem, I want to find an Arc between two points, A and B, using 5 arguments: Start Point End Point Radius (Don't know if this is needed) Angle Quality Example: StartPoint…
Mário Gabriel
  • 367
  • 1
  • 2
  • 13
1
vote
1 answer

Get coordinate from path with multiple points based on fraction of path's distance

I have an array where every array value is an object { lat: ___, lng: ___ }. I'd like to input a fraction (let's say 20% (0.2)) and get the specific coordinate for that fraction, based on the distance from point 0. What this means that given the…
Magnus
  • 391
  • 1
  • 7
  • 35
1
vote
2 answers

How to programatically process the image to black and white and separate out the polygon

I have an image that represents a polygon. I want to process it in matlab and generate the image below. Basically i am asking to separate the polygon from the rest of the image out. This question got inspired here.
user_1_1_1
  • 903
  • 1
  • 12
  • 27
1
vote
2 answers

Drawing random values from a Fisher Distribution

In my research, I am generating discrete planes that are intended to represent fractures in rock. The orientation of a fracture plane is specified by its dip and dip direction. Knowing this, I also know the components of the normal vector for each…
Flux Capacitor
  • 1,215
  • 5
  • 24
  • 40
1
vote
1 answer

Minimum Cost Polygon Rectangulation

Given a n*n grid which contains P points, what is the total minimum cost to cover P points using rectangles which must contain exactly K points, cost being the perimeter of rectangles. 1. This problem seems similar to polygon triangulation with an…
1 2 3
99
100