computational-geometry

Would a course on parallel computing covering these topics be useful for somebody interested in AI, learning, computational geom, and comp vision?

I am interested in learning about topics like AI, machine learning, computer vision, computational geometry, etc. I'm not sure which field I'd like to focus more on yet, but these are topics that are of general interest to me. My school is offering a course tagged as a "parallel and multicore computing" course, and I spoke t...

Merge two gridded data layers

i have two difrent sets of xyz data of different resolution for eadh i have used GMT's pscontour i would like to merge these data frames(add them up an counter the, together) does any body know a good utility to do this ...

Divide grid (2D array) into random shaped parts?

The Problem I want to divide a grid (2D array) into random shaped parts (think earth's tectonic plates). Criteria are: User inputs grid size (program should scale because this could be very large). User inputs grid division factor (how many parts). Grid is a rectangular shaped hex grid, and is capped top and bottom, wrap around ...

Algorithm to get aspect raio of a irregular shape

Im developing an image analysis app and need to calculate the aspect ratio of a segmented particle. According to http://www.sympatec.com/Science/Characterisation/05_ParticleShape.html the AR is given by (FIG 1) Xfmin/Xfmax. Any suggestion of an algorithm to get this values (Xf)? ...

Simplified concave-hulls

Problem: Given: n points that are strongly correlated to a 3d k-sided non-convex polygon, where n >> k Find: the best fit concave-hull that matches the original geometry of the points Attempted solutions: Warning: pseudocode segments = [] for each point in image: #segment points into planes via comparing approximate normals ...

Trilateration in a 2D plane with signal strengths

Hi, first question to StackOverflow, please be gentle. I am trying to find the equation (and then the algorithm for) the center point of three different points on a 2D cartesian plane, given a certain magnitude or "signal strength". These signal strengths are all on a scale relative to each other, but shouldn't necessary be conflated ...

Compute perpendicular vector to a known vector, both embedded in the same plane, in 3D (R^3)

Hi, it seems to me that this is kind of a very easy question, but today I don't seem to find a reasonable answer by myself. I have two points, A and B in R^3 (3D) that belong to plane PI. I want to find a vector r in PI, perpendicular to the vector v = A - B. I know vector n, the normal of plane PI. Mathematically I can solve v.r = 0 an...

Rotation about a given point

I have a point, let's say p(0.0, 0.0, 20.0) which I want to rotate about point a(0.0, 0.0, 10.0) in XZ plane. What is the simplest way to do it? I am using Qt with QVector3D and QMatrix4x4 to perform transformations. Everything I can think of is something like that: QVector3D p(0.0, 0.0, 20.0); QVector3D a(0.0, 0.0, 10.0); QMatrix4x4 m...

Java - Draw a ruler (line with tick marks at 90 degree angle)

Hello all, I'm using Java AWT to draw lines on a panel (Line2D & and Graphics2D.drawLine) and I'm wondering how I can draw a line with tick marks, similar to: |----|----|----|----|----| I know the positions I'd like to draw the ticks at in advance. The lines could be in any position, so the ticks must be drawn at an angle releative t...

Algorithm for Max and Min diagonal of a convex polygon?

Is there a way better than a brute force comparison to get the max and min length diagonals of a polygon? To be more specific, I would like to find the ratio, so I can sort polygon on their "skinniness." The polygons aren't too large (usually 4-8 faces per polygon), but there's a lot of them. I thought I'd just check with SO to see if ...

Recognizing edges based on points and normals

Hi guys, I have a bit of a problem categorizing points based on relative normals. What I would like to do is use the information I got below to fit a simplified polygon to the points, with a bias towards 90 degree angles to an extent. I have the rough (although not very accurate) normal lines for each point, but I'm not sure how to sepa...

Java AWT - Draw a Polygon connected by smooth curved lines

Here I am asking more silly graphics questions. Hopefully soon I will leave the world of graphics behind and plant myself firmly in the color-less middle-tier again. I have a newfound respect for people who are able to fiddle with images in pleasing ways through code. That said, I am drawing a Polygon on a canvas. It can have an arbitra...

How to compute a point on a line in CGAL

Given a 3D line in CGAL, how do I compute a point on that line that is some known distance from an endpoint? ...

Fill arbitrary 2D shape with given set of rectangles

I have a set of rectangles and arbitrary shape in 2D space. The shape is not necessary a polygon (it may be a circle), and rectangles have different widths and heights. The task is to approximate the shape with rectangles as close as possible. I can't change rectangles dimensions, but rotation is permitted. It sounds very similar to pac...

How to calculate inverse kinematics

I want to know how to calculate rotation angles using inverse kinematics. I am planning on using this for real time 3d animation. Anyone know of some good literature that details a specific solution? ...

Scaling Arbitrary oriented and dimensioned 3D boxes for force no intersection

Hi all, I have a set of 3D boxes with arbitrary dimensions, translations and rotations. I need to force the boxes not to intersect by scaling them by a single constant over their 3 dimension components. At the moment I am doing this iteratively by checking for intersection and then reducing the scaling iteratively until there is no i...

Quaternion and three axes

Given a quaternion q, and three 3D vectors (vx, vy, vz) which form coordinate axes, which can be oriented in arbitrary direction, but are all perpendicular to each other, thus forming a 3d space. How can I check if the quaternion q is rotated to the same direction (or opposite direction) as some of the 3D vectors (vx, vy, vz)? ...

Object quaternion parallel or perpendicular to all basis vectors

Given an object quaternion q, and basis vectors vx, vy, vz forming a 3D space, how can I check whether the quaternion is parallel or perpendicular to all of the basis vectors? For example, I have basis vectors: vx = (0.447410, 0, -0.894329) vy = (0, 1, 0) vz = (0.894329, 0, 0.447410) and quaternion q(w,x,y,z) = (-0.973224, 0, -0.22986...

Accessing vertices in the triangle++ (delaunay/voronoi triangulation) Wrapper class

Hi, I'm using the triangle++ wrapper class from http://www.compgeom.com/~piyush/scripts/triangle/ to triangulate a point cloud for visulaizing with OpenGL. I was able to put in my points and caluculate the triangulation. After that i also was able to access the vertices over a vertex iterator, how it is shown in the main.cpp example inc...

Is a KD-Tree a unique ordering of a given data set?

Given a set of data points, a kdtree is created over them, but is this kdtree a unique one? ...