Questions tagged [geometry]

Data structures and algorithms related to geometry.

Data structures and algorithms related to geometry, a branch of mathematics concerned with questions of shape, figures, and dimensions in space.

See also Wikipedia

12992 questions
5
votes
3 answers

My assignment is to make a house using for loops. The house should look like this

* ***** ********* ********* **** *** **** *** so far i only have this for (int i=1; i<10; i += 4) { for (int j=0; j
5
votes
2 answers

Given a circle with N defined points and a point M outside the circle, find the point that is closest to M among the set of N. O(LogN)

http://www.glassdoor.com/Interview/Google-Interview-RVW2382108.htm I have tried to come with a solution to this problem. But I have not been successful.. Can any one please give me a hint as to how to proceed with this problem. I will take 2 pair of…
yuvi
  • 1,019
  • 2
  • 14
  • 21
5
votes
3 answers

generate 3-d random points with minimum distance between each of them?

there. I am going to generate 10^6 random points in matlab with this particular characters. the points should be inside a sphere with radious 25, the are 3-D so we have x, y, z or r, theta, phi. there is a minimum distance between each…
Sahar P.H.Z
  • 53
  • 1
  • 4
5
votes
2 answers

Finding whether a point is within a triangle

I have been on this for hours, attempting different methods looking at just about every question. Perhaps I have it completely wrong, but I feel that I have my math of it correct, but no matter what numbers I input, I get the same output. My code…
Lish
  • 231
  • 4
  • 6
  • 14
5
votes
1 answer

Triangular css button image

I'm trying to make a splash page on my website with 2 large buttons, each a right angled triangle, and both join by the longest side to create a square. Basically I'm looking to find out how to make non-rectangular buttons in css. I have no idea if…
Ryan Connolly
  • 607
  • 1
  • 7
  • 15
5
votes
2 answers

OpenGL: Is it more efficient to use GL_QUADS or GL_TRIANGLES?

I know that OpenGL deprecated and got rid of GL_QUADS in the newer releases. I have heard this is due to the fact that modern GPUs only render with triangles so calling a quad would just make the GPU work harder to break it into two triangles (what…
CoderTheTyler
  • 839
  • 2
  • 11
  • 30
5
votes
2 answers

How to find points on the circumference of a arc knowing a start point, an end point and the radius?

Please see the image below for a visual clue to my problem: I have the coordinates for points 1 and 2. They were derived by a formula that uses the other information available (see question: How to calculate a point on a circle knowing the radius…
jayfield1979
  • 355
  • 1
  • 5
  • 16
5
votes
1 answer

Detect tetrahedra within a triangulated mesh?

Let's say I have a mesh that has lines connecting the vertices in a way that would allow it to be split into tetrahedra. Is there an algorithm I can use to detect the presence of the tetrahedra given the vertices and lines? (I.e., given the mesh…
Conner Ruhl
  • 1,693
  • 4
  • 20
  • 31
5
votes
3 answers

Responsive CSS circles that can hold centered content

I am searching for a way to create a responsive CSS3 circle that can hold centered content. Regarding the circle, I found some good info in this question. Too bad it seems that one can't center the content in this one. This question is also pretty…
Sven
  • 12,997
  • 27
  • 90
  • 148
5
votes
2 answers

Find out if 2 lines intersect

Possible Duplicate: How do you detect where two line segments intersect? Determining if two line segments intersect? Given are two lines l1=((A0, B0), (A1, B1)) and l2=((A2, B2), (A3, B3)); Ax, Bx are integers and (Ax, Bx) specify the starts and…
user1861174
  • 507
  • 1
  • 5
  • 14
5
votes
1 answer

WPF - Path Geometry...Is there a way to bind the Data Property?

I have a ControlTemplate that serves as a "Bubble" popup on the AdornerLayer of a given control. It works fine but I need to be able to calculate where it should display (middle/ bottom). Instead of:
tronious
  • 1,547
  • 2
  • 28
  • 45
5
votes
3 answers

Check if a set of coordinates are contained within a shape

Possible Duplicate: Detect if CGPoint within polygon I have the coordinates of a set of touches from a UIEvent. Is there a way to check if they are contained within a certain shape -- a polygon -- that I can define? I have experience in Java, and…
5
votes
2 answers

Converting vertex normals to face normals

I have a triangulated polyhedron (not necessarily convex) and the following information: A list of the position of each vertex. A list of the vertex triples that define each face. A list of the vertex normals (Here the vertex normals are vectors…
user1873329
  • 111
  • 2
  • 4
5
votes
2 answers

Detect a shape as a circle with Matlab

I am writing a program in Matlab to detect a circle. I've already managed to detect shapes such as the square, rectangle and the triangle, basically by searching for corners, and determining what shape it is based on the distance between them. The…
theJuls
  • 6,788
  • 14
  • 73
  • 160
5
votes
1 answer

geometry of colorbars in matplotlib

Plotting a figure with a colorbar, like for example the ellipse collection of the matplotlib gallery, I'm trying to understand the geometry of the figure. If I add the following code in the source code (instead of…
bzklrm
  • 153
  • 4
1 2 3
99
100