Questions tagged [convex]

Anything related to convex geometric shapes. A shape in an Euclidean space is convex if, given two points A and B, every point of the segment AB belongs to the shape, i.e. AB is a subset of the shape.

Anything related to convex geometric shapes.

A shape in an Euclidean space is convex if, given two points A and B, every point of the segment AB belongs to the shape, i.e. AB is a subset of the shape.

See Wikipedia on:

139 questions
4
votes
1 answer

Why aren't neural networks convex?

Unlike linear and logistic regression, ANNs cost functions are not convex, and thus are susceptible to local optima. Can anyone provide an intuition as to why this is the case for ANNs and why the hypothesis cannot be modified to produce a convex…
4
votes
3 answers

Gift Wrapping Algorithm with Collinear Points

So I've written the following code based on examples of the Gift Wrapping Algorithm for finding the Convex Hull of a group of points: std::vector convexHull(const std::vector& _shape) { std::vector
Stefan Dimitrov
  • 302
  • 1
  • 14
3
votes
2 answers

Winding number algorithm and point on boundary/edge of convex

I need algorithm which can tell, if Point lies inside/outside or on boundary (edge) of convex hull (C/C++). Convex hull is described as array of Points X,Y, integer, connection are from i to i+1. Currently Im using winding number algorithm,…
user3157855
  • 714
  • 2
  • 9
  • 24
3
votes
1 answer

Concave hull algorithm from pseudocode to C#

I am trying to convert the algorithm as described here (page 12) from pseudocode into working C# code. The algorithm describes how a convex hull is 'transformed' into a concave hull by breaking up edges that are considered too long into smaller…
WalterB
  • 110
  • 2
  • 12
3
votes
1 answer

Maximizing linear objective subject to quadratic constraints

I have a programming formulation from a paper and want to give it a tool for solving specific problems. The authors stated it as an linear programming (LP) instance, however I am not sure. Formulation is somewhat like as follows: max…
3
votes
1 answer

Add a corner to a polygone

I'm creating a tool where I have a map in JavaFX. I have to draw a existing polygon on that map in order to create zones on it for a location service. Then I want to click somewhere on the map to add a new corner to this polycon. Now, adding a…
user3354754
  • 79
  • 1
  • 7
3
votes
3 answers

Determine if vertex is convex. Help understanding

I am studying the following code. boolean convex(double x1, double y1, double x2, double y2, double x3, double y3) { if (area(x1, y1, x2, y2, x3, y3) < 0) return true; else return false; } /* area: determines area of triangle…
BlueBug
  • 369
  • 4
  • 17
3
votes
3 answers

find convex an concave corners in a polygon

I am trying to detect if a corner is concave or convex in an arbitrary polygon. I made the function below that computes the angle between all edge-pairs. however one never knows if the if it is the inner or the outer corner angle that it returns. I…
timkado
  • 1,922
  • 2
  • 17
  • 27
3
votes
3 answers

Check if an angle defined by 3 points is inner or outer

I've found a problem with the detection of angle types (whether inner or outer wrt the origin of axes), given a set of polylines. I've found dozens of very similar questions, but none of them solved my problem, so I put it here in hope something…
jalone
  • 1,953
  • 4
  • 27
  • 46
2
votes
2 answers

How to check convexity of data in R?

I am trying to use a function to identify the convexity of data, instead of using visual observations from plots. Here is the data: x1 x2 x3 y 1 2.302585 0.8340324 -0.181482974 1.455921 2 2.397895 0.8745914…
J.Z.
  • 415
  • 2
  • 11
2
votes
1 answer

TypeError: tri() missing 1 required positional argument: 'N'

I can't get past the error: > --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () 7 d_unpair =…
2
votes
1 answer

GeoJson : build a Polygon based on Point feature

Dear Stackoverflow team, I'm impressed that after a bunch of hours digging the forum I still can't find any question/answer similar to my problem : I have a GeoJson with a lot of Points features. I collect all Points (green in my example, see figure…
2
votes
2 answers

How do I split a convex polygon into two areas of a given proportion?

Given a convex polygon P and a point A on P's boundary, how do I compute a point B also on P's boundary such that AB splits P into two areas of a given proportion? Ideally I'd like an analytical solution. As a last resort I can draw a line anywhere…
2
votes
1 answer

tetgen library- tetrahedralize without convex hull

I am trying to tetrahedralize my mesh using tetgen library. However it creates convexhull on the mesh like in the picture. How can I tetrahedralize my mesh while preserving boundary surface of the mesh using tetgen library?
user3117189
  • 69
  • 3
  • 9
2
votes
1 answer

Exterior penalty function method

I am trying to implement an exterior penalty function method for minimizing the below problem. min f(x)=100*(x(2)-x(1)^2)^2+(1-x(1))^2 s.t, x(1)+2x(2)<=1 2x(1)+x(2)=1 First of all, I have found the minimum using fmincon, which the answer is x:…
1
2
3
9 10