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
2 answers

Random point inside SVG

The problem is really simple to describe. I have a simple SVG closed shape, like this: I want to draw a point at random, somewhere inside this…
Rok Kralj
  • 46,826
  • 10
  • 71
  • 80
5
votes
2 answers

Drawing an imperfect circle

Programatically drawing a perfect circle is not all that difficult. It's based on some very simple math, afterall. You input two parameters (a center and a radius) and output the circle. But if you don't have tools to help you, drawing a circle…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
5
votes
6 answers

Generate random points inside a rectangle (uniformly)?

I am trying to generate a certain amount of random uniform points inside a rectangle (I know the pair of coordinates for each corner). Let our rectangle be ABCD My idea is: Divide the rectangle into two triangles by the AC diagonal. Find the slope…
Silent Control
  • 614
  • 10
  • 22
5
votes
0 answers

How to rotate an object defined by x y z points around the x y or z axis

I'm working with a program where I visualize molecules. The molecules are represented by multiple x, y, and z values for each atom. What I would like to be able to do, is some math on each coordinate and have the resulting molecule be rotated on one…
Aaron Germuth
  • 181
  • 4
  • 10
5
votes
2 answers

Import ORACLE SDO_GEOMETRY to SQL Server Geometry

I'm building a service which selects a number of geometries from a system that stores its geometries in an Oracle 10g, and then save a copy of those into a SQL Server database for use by another system. Looked first at SDO_UTIL.TO_WKTGEOMETRY().…
Johan Helsén
  • 323
  • 4
  • 12
5
votes
5 answers

Find if points are within a circle with given center and radius

We have a point (x,y) and a set of some other points (xi,yi). How can we determine which of (xi,yi) are within a circle with center (x,y) and radius r (a given number)?
jim
  • 69
  • 1
  • 2
5
votes
4 answers

How to find the polygon enclosing a point from a set of lines?

I have a set of non-intersecting lines, some of which are connected at vertices. I'm trying to find the smallest polygon, if one exists, that encloses a given point. So, in the image below, out of the list of all the line segments, given the point…
Skyler
  • 909
  • 1
  • 10
  • 24
5
votes
4 answers

How to find delaunay triangulation facets containing the given points

I have plotted n random points (the black points) and used delaunay triangulation, now I want to interpolate m random evaluation points (the red points) so I need to calculate which triangle the evaluation point is inside. What is the approach for…
Chris Seymour
  • 83,387
  • 30
  • 160
  • 202
5
votes
1 answer

Javascript point to point angle calculation

We got 3 points: start, end and mail. The mail image, moves in a curved line from the start and end point, this is done by jQuery animate. Now the next step is to make the mail image rotate while the animation is running. So at the start point and…
randomKek
  • 1,108
  • 3
  • 18
  • 34
5
votes
3 answers

project a sphere to a plane using matlab

This is probably very basic matlab, so forgive me. I use the command sphere to create a 3D sphere and have the x,y,z matrices that will produce it using surf. For example: [x,y,z]=sphere(64); I'd like to project (or sum) this 3D sphere into one of…
user2066183
5
votes
3 answers

Finding the intersection between two lines

So I've been banging my head over this relatively simple algorithm. I'm not sure what's wrong in my code yet I'm not getting the intersection point where they are actually intersecting. I'm using Unity3D and I'm trying to find the point where two…
Jonny
  • 2,787
  • 10
  • 40
  • 62
5
votes
1 answer

Computational geometry algorithm which can deal with conic arc segments

I've just finished reading a book named "Computational Geometry Algorithms and Applications". The algorithm introduced in this book is very helpfull for my future work. But algorithm in this book only concerned about straight line segments. what i…
Jessica
  • 47
  • 4
5
votes
2 answers

Get intersection points of line and shape

I have a custom shape as shown in image. Suppose the blue rectangle covering the shape in the image depicts the bounding box of that shape. If I draw line at one of the diagonal of the bounding rectangle, how can I get the intersection points (in…
Mihir
  • 2,480
  • 7
  • 38
  • 57
5
votes
2 answers

Find all the points of a cubic bezier curve in javascript

I have a cubic bezier with 2 control points. Starting point and control points are known. Need to get all the points of the curve, given the control, starting and ending points. What I wanna to achieve is ..given a value i from 1 to length of…
Claudio Ferraro
  • 4,551
  • 6
  • 43
  • 78
5
votes
2 answers

Trying to calculate the angle between two points on a circle?

First and foremost let me say I am an absolutely atrocious at maths, please bear with me. I'm trying to calculate the angle between two points on a circle, the two points being the distance the user has dragged in a certain amount of time. This is…
styke
  • 2,116
  • 2
  • 23
  • 51
1 2 3
99
100