11
голосов
4ответов
5315 просмотров

How to map a point onto a warped grid

Say you have a collection of points with coordinates on a Cartesian coordinate system. You want to plot another point, and you know its coordinates in the same Cartesian coordinate system. However, the plot you're drawing on is distorted from the original. Imagine taking the original plane, ...

1
голосов
1ответов
1946 просмотров

Combine multiple Ellipses

I need a way to combine multiple EllipseGeometry to make a union between them, but CombineGeometry class only can combine 2 Geometries. The ideal way is to have a class similar CombineGeometry that accepts more than Geometry1 and Geometry2 shapes. Anyone knows an object that makes such a behaviour?

0
голосов
1ответов
978 просмотров

Modifying a convex hull to exclude unwanted points

In my C#-Silverlight 3 program, I have a set of points. Those points can be of a different color, green, red or blue. Then I create a convex hull for the different points: A hull for green, a hull for red and a hull for blue. Now it can happen, that within the hull of each color are points from a...

3
голосов
3ответов
7752 просмотров

Calculate 3D vector perpendicular to a plane generated by two vectors

I am new to dealing with 3D, and even simple stuff makes my head spin around. Sorry for the newbie question. Lets say I have 2 vectors: a(2,5,1) b(1,-1,3) These vectors "generate" a plane. How can I get a third vector perpendicular to both a and b? I can do this in 2D using a vector c(A,B) a...

54
голосов
11ответов
59689 просмотров

How to find the intersection point between a line and a rectangle?

I have a line that goes from points A to B; I have (x,y) of both points. I also have a rectangle that's centered at B and the width and height of the rectangle. I need to find the point in the line that intersects the rectangle. Is there a formula that gives me the (x,y) of that point?

10
голосов
5ответов
18518 просмотров

What's the most efficient way to detect triangle-triangle intersections?

How can I tell whether two triangles intersect in 2D Euclidean space? (i.e. classic 2D geometry) given the (X,Y) coordinates of each vertex in each triangle.

8
голосов
5ответов
3397 просмотров

Find if an angle is within X degrees from another

I need an algorithm to figure out if one angle is within a certain amount of degrees from another angle. My first thought was (a-x < b) && (a+x > b), but it fails when it has to work with angles that wrap around from -179 to 180. In the diagram above, the region (green) that the...

1
голосов
5ответов
4685 просмотров

Diagonals of quadrilateral

Is there any way to find out diagonals of quadrilateral if I only know the four sides - no angles? I understand I could calculate it with the law of cosines: p = sqrt( a^2 + b^2 - 2*a*b*cos(α) ) q = sqrt( b^2 + c^2 - 2*b*c*cos(β) ) // or whatever you name these angles but I don't know the a...

3
голосов
2ответов
3616 просмотров

Circle-Rectangle collision detection finished exampe

I need a algorithm for detecting if a circle has hit a square, and I saw this post: Circle-Rectangle collision detection (intersection) It looks like I should go for ShreevatsaR's answer, but I am a math fool, and I have no idea how to finish the algorithm. Could anyone find the time to make a c...

1
голосов
2ответов
582 просмотров

Arranging triangles in grid order

My program generated triangles automatically, however the arrangement of the triangles are random on JPanel. How can I plot the triangle in a grid order? Thanks. EDITED: for(int i = 0; i < 10; i++) { xCoord[0] = generator.nextInt(MAX_WIDTH); yCoord[0] = generator.nextInt(MAX_HEIGHT...

31
голосов
5ответов
56823 просмотров

Line Equation with angle

How can I find equation of a line or draw a line, given a starting point, length of line and angle of line (relative to x-axis)?

0
голосов
2ответов
192 просмотров

Vertices selection and state of model after rotation

I'm currently writing an application that actually acts as a "cut" tool for 3D meshes. Well, I had some problems with it now which I am clueless on how to solve, since it is my first application. I have loaded a model from an object file onto the canvas, then on the same canvas, I use the mouse...

130
голосов
13ответов
130877 просмотров

How to tell whether a point is to the right or left side of a line

I have a set of points. I want to separate them into 2 distinct sets. To do this, I choose two points (a and b) and draw an imaginary line between them. Now I want to have all points that are left from this line in one set and those that are right from this line in the other set. How can I tell ...

1
голосов
2ответов
2716 просмотров

2D Triangle in SlimDX

How to draw a triangle using SlimDX's Direct2D interface given triangle vertices are given in pixel coordinates?

3
голосов
1ответов
3089 просмотров

Combine KML Polygons in PHP

I have a problem with the Google Maps API only allowing 1000 features per map. In a database, I keep records of areas. Each area has associated with it a heap of KML polygon information, stored as an XML string. Each area is made up of one or more polygons. Given some user input, a handful of t...

4
голосов
2ответов
4584 просмотров

Intersection on circle of vector originating inside circle

I have a circle. Inside the circle is a point. I have a vector originating at this point. I'd like to know what point on the circle this vector intersects. Here is a drawing: http://n4te.com/temp/circle.png http://n4te.com/temp/circle.png The red dot is the point I am trying to determine. I kn...

2
голосов
1ответов
279 просмотров

Suggestions on generating abstract little images like StackOverflow 'flair' image

I'm creating a webapp that has various unrelated data types (House, Contact, Article, Recipe, Fact -etc). I am giving each one a 'thumbnail' automaticaly. (User can then manually upload there own image). Currently, I'm grabbing an image from Flikr, crop or strech to 80x80 & adding a mosaic ...

4
голосов
1ответов
1447 просмотров

Layering intersecting elements with jQuery

I have a page with draggable/droppable elements that once dropped need to calculate their left position and width in regards to other draggables that they may be touching. This isn't too hard in and of itself, but where I'm really having trouble is getting them to fill in empty space. How do I g...

1
голосов
3ответов
343 просмотров

How can I generate images of circles, of varying sizes?

For the task I'm trying to accomplish, I need to generate many images, all consisting of a black circle border on a transparent background, but each a different size (going up in size from 3x3 to, say, 20x20). Preferably they would be GIFs or PNGs, as these support transparency. I started build...

0
голосов
6ответов
1201 просмотров

Moving between two specific points

I want to find out the X and Y position of a point which is halfway between a point and another point, in VB.net. Since there is no "direction" property (which would make this much easier...), I have no idea how to do this. C# code is acceptable as well, though I would prefer vb as it wouldn't r...

1
голосов
5ответов
3956 просмотров

Extend a line segment to bounding box

I have two points a and b, and a bounding box at 0,0,w,h. Both points are within the bounding box. How do I extend the line segment created by a and b to find points c and d where the line intersects the box? *c-------------* | \ | | \ | | a | | \ | ...

17
голосов
8ответов
5879 просмотров

Where to study computational geometry?

I want to solve geometry problems in online programming contests. But whenever I read them, I just find too difficult. Please suggest some books and resources which I can study computational geometry.

1
голосов
2ответов
104 просмотров

How should I index for a simple world of rectangles?

The world consists of many (1k-10k) rectangles of similar sizes, and I need to be able to quickly determine potential overlaps when trying to add a new rectangle. Rectangles will be added and removed dynamically. Are R-Trees appropriate here? If so, are there any good libraries I should consider?...

14
голосов
4ответов
25120 просмотров

Find the normal angle of the face of a triangle in 3D, given the co-ordinates of its vertices

As you may be able to tell from this screenshot, I am trying to make a physics engine for a platformer I am working on, but I have run into a definite problem: I need to be able to find out the angle of any one of the triangles that you can see make up this mesh, so that I can work out the rotati...

4
голосов
3ответов
2607 просмотров

Texturing error on a Sphere

I have a number of spherical longitude/latitude coordinates for points on a sphere that I need to visualize. For that purpose, I transformed the points to cartesian coordinates and built a mesh of triangles that I can render with VTK. Works so far. Now I want to use a texture for the sphere mode...

2
голосов
2ответов
4220 просмотров

How to find the minimum radius circle that encloses all the given points?

Suppose I have some 1000 odd points on a plane. Then, what I think could be done is to discard the points that do not affect the radius of the circle in any way - the points through which the convex hull does not pass [using one of the several algorithms]. This leaves us with points that do matt...

0
голосов
2ответов
3148 просмотров

How to plot triangles on a 6x6 grid in MATLAB?

I have a file a.txt which is like: 0 0 0 3 4 3 0 0 3 0 3 4 0 1 0 4 4 4 0 1 3 1 3 5 0 2 0 5 4 5 0 3 0 0 4 0 These are vertices of triangles [x1 y1 x2 y2 x3 y3] that I need to plot on a 6x6 grid. I need to see these triangles on a single graph. How can this be done in MATLAB? ~~~~~~~~~~~~~~~~~...

3
голосов
2ответов
1360 просмотров

Data structure for fast line queries?

I know that I can use a KD-Tree to store points and iterate quickly over a fraction of them that are close to another given point. I'm wondering whether there is something similar for lines. Given a set of lines L in 3D (to be stored in that data structure) and another "query line" q, I'd like t...

9
голосов
3ответов
16096 просмотров

Triangle Triangle Intersection in 3d-Space

I'm working with some 3d geometry. I need to find the intersection of triangle with another triangle. What algorithm could I use?

1
голосов
3ответов
3558 просмотров

Multiply two Point objects

I have noticed in other languages such as Java that there are Objects such as Vector2d that have a multiply method. How would I do the same with Actionscript 3? I know that the Point or Vector3D classes have add/substract methods, but neither offer multiply/divide methods. What is the best way t...