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
0
votes
1 answer

C++ / SFML: Printing convex shapes to the screen using two recursive calls only displays the shapes from the first recursive call and not the second

I am using SFML and coding in C++. The program I am writing must be a recursive implementation. My goal is to create a function that recursively draws a square to the screen in different positions and rotations dependent upon the previously drawn…
user9477548
  • 87
  • 11
0
votes
1 answer

Why do polygons have to be simple and convex?

Why is it so important that polygons you push through the pipeline be "simple" and "convex"?
0
votes
2 answers

Sort 2D points counter clockwise

My question is related to this one: c++ Sorting 2D Points clockwise, but somehow that solution doesn't work for me. I am trying to sort 4 2d points counter clockwise. This is my code: typedef struct p { float x,y; } Point; double…
Cosmin Stoian
  • 19
  • 1
  • 8
0
votes
1 answer

Julia error using convex package with diagind function

I'm trying to solve the problem d = 0.5 * ||X - \Sigma||_{Frobenius Norm} + 0.01 * ||XX||_{1}, where X is a symmetric positive definite matrix, and all the diagnoal element should be 1. XX is same with X except the diagonal matrix is 0. \Sigma is…
Xia.Song
  • 416
  • 3
  • 15
0
votes
1 answer

Convex optimization in R with sqlp function

With the following convex problem: minimize ∥Ax−b∥2 subject to l⪯x⪯u It could be done in matlab with CVX, with SDPT3 solver: cvx_begin variable x(n) minimize( norm(A*x-b) ) subject to l <= x <= u cvx_end In this way, R has a…
PeCaDe
  • 277
  • 1
  • 8
  • 33
0
votes
1 answer

CGAL: Simplify convex polyhedra in 3D

I have been using the cgal library to generate convex hulls which are further used for discrete element simulations. Currently, I am trying to make the polyhedral particles break, which is right now implemented as plane clipping of the polyhedron.…
paffff
  • 1
0
votes
1 answer

Triangulating a planar 2D concave polygon in 3d space - Help checking concavity?

I have a set of 3d points that form a 2d polygon. They are ordered in either clockwise or counter clockwise order (one or the other, but I don't know which beforehand). Now, I want to triangulate it, which I'm trying to do by using a ear cutting…
kace91
  • 821
  • 1
  • 10
  • 23
0
votes
1 answer

How to combine plots from ggplot2 and boxplotdou?

I'll try to explain my problem by using a modified code from here: https://stats.stackexchange.com/questions/22805/how-to-draw-neat-polygons-around-scatterplot-regions-in-ggplot2 In my example, I use the Iris data set. My attempts have produced this…
0
votes
2 answers

Convex Optimization in Python

I recently got interested in soccer statistics. Right now I want to implement the famous Dixon-Coles Model in Python 3.5 (paper-link). The basic problem is, that from the model described in the paper a Likelihood function with numerous parameters…
Patrick
  • 41
  • 1
  • 5
0
votes
1 answer

Generate convex polygons from rectangles

I am currently working on a 2D lighting system for a game. The maps are composed of tiles which can have certain tags and traits. In this case I have set some tiles as "opaque" and written a function to generate a bunch of rectangles for each opaque…
0
votes
1 answer

An algorithm computing the number of vertices

Let CH1 and CH2 be two convex polygons. Give an algorithm computing, in time linear with the number of vertices, the convex hull of their union justifying that it works in all the different possible cases of mutual relations between the two…
Deepinfo
  • 31
  • 2
0
votes
1 answer

OpenGL C++ Occlusion Query

In Christer Ericson great book on Collision Detection, he gives an accelerated GPU method for detecting collision among convex polygons with the following algorithm. I'm completely new to OpenGL, and my question is, given two std::vector of Points…
DaynaJuliana
  • 1,144
  • 1
  • 14
  • 33
0
votes
0 answers

Concave to convex- shortest way from point to circle

I have the optimization problem. I need to find the shortest way from point inside the circle to circle's perimeter. The function of constrains is concave. To make it works, I need to change this concave function to convex. I looked for "Poles of…
kubauser
  • 21
  • 4
0
votes
0 answers

Matlab: cvx convex programming error

I am new to cvx and get an error in solving the following convex problem: In the above formulation, L=|E|, 'p' and 'm' are given positive real indices. Here is my code: cvx_begin variable x(L,L); …
fhm
  • 57
  • 1
  • 11
0
votes
1 answer

How to make a curve line straight?

Just imagine that you have a curved line. How could you make it a straight line? Do you know any paper or algorithm that can help me out? I know that I one way of doing it is defining an energy function; but, I do not have any idea of what the…
Raimond
  • 33
  • 5