Separation of datum and decision of their mistake - Page 1
Forum section: electronics / beginners

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 12:19:50 am
content: Hi,I have a general problem(not exactly with electronics, computers etc.)Think like this. I have dots which I know their positions in x-y coordinates. They have numbers. 1-2-3-4.....98-99-1001-2-11-12 are neighbor2-3-12-13 are neighbor11-12-21-22 are neighborbut 2-3-12-14there is a problem. 14 isn't neighbor with 2-3 and 12As I said, I have only X-Y axis and their coordinates. Matlab is very convenient platform to work. Firstly, I will deal with diagonal data like below.On image, everything is okay. I am trying to find a way and check they are okay or not.

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 12:50:41 am
content: So what is the problem? To check if given 4 numbers are close on a 10x10 grid? Are they always be sqares?If so, it appears to be pretty easy in abstract. Pick the lowest number (N). One other number must be N+1. You have established lower base of your square.The other numbers must be N+10 and N+11.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 01:17:30 am
content: You are right but when complexity increases, there are some problems with working only distances.My datum are never locating like exactly diagonal but if you check them with eyes, they preserve their diagonal shape. For example,there is no problem.there is a problem.or there is a problem.Now, my program works with calculating their distances and some cases it gives wrong result so, working with distance is not true approach for that problem.

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 01:19:33 am
content: I don't understand any of your pictures. What I'm supposed to be seeing there?The problem is someting you formulate. Do so.If they are not located on the grid, then how are they numbered? Is it always groups of 4? What do you actually want to know?

author: xrunner
author_rank: Super Contributor
timestamp: December 11, 2017, 01:30:06 am
content: Quote from: Karamel on December 11, 2017, 01:17:30 amI don't understand either. Any given placement of random points on an X-Y grid will yield values you can calculate for each point to any other existing point. Then you have a list of distances for comparison. That's all the information there is to get - XY of each point, the number of points, and distances to other points. I don't know how it can give a "wrong" result.You seem to be leaving us with a gap in understanding of what you are trying to achieve.

author: cncjerry
author_rank: Unknown
timestamp: December 11, 2017, 01:36:15 am
content: if neighbor implies distance, then just compute a circle around each of the points and see if the target points lie within the circle radius (neighbor distance). Or just compute the vector distance from each point and see if it is less than the neighbor distance. both solutions imply an x,y grid.this sounds like the traveling salesman problem and if I remember correctly, the solution in terms of minimum distance has been found.Another way to do it is to take the x,y points and load them into just about any drilling optmization program and let it figure it out.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 01:37:07 am
content: Quote from: ataradov on December 11, 2017, 01:19:33 amThis is my trap. Every data must be located square, otherwise, I have a problem but, you don't understand that it doesn't must be exact square.Quote from: xrunner on December 11, 2017, 01:30:06 amDistance calculation doesn't give me any folding information. Therefore, it gives wrong result.

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 01:41:12 am
content: Quote from: Karamel on December 11, 2017, 01:37:07 amHow do you number things. You need to mathematically define what "exact square" means in your case.If you it is still good enough that you can obviously align things, then it does not matter. If it is not good enough, then it is a totally different task. Any you need to give way more information.What is the source data that you have. Can you post actual list of points, and identify a few places you want to pass/fail. Pictures in task like this don't help at all.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 01:42:34 am
content: Okay guys,I have an idea, maybe, I can use voronoi diagram for this problem. Every neighbor must share neighbor area otherwise, there is a problem but how can I implement it?(This is such a image which shows what voronoi is)

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 01:43:31 am
content: We don't understand what the problem is. How would we know if this will solve it?

author: xrunner
author_rank: Super Contributor
timestamp: December 11, 2017, 01:52:57 am
content: Quote from: Karamel on December 11, 2017, 01:42:34 amOK a voronoi diagram ... I didn't study it in my field but OK -https://en.wikipedia.org/wiki/Voronoi_diagramIt exists and can be generated - but for what reason?As has been stated -What is the problem you want to solve?

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 01:53:18 am
content: Quote from: hamster_nz on December 11, 2017, 01:52:06 amI already proposed that. But this does not work for non-exact squares, whatever that is.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 01:55:04 am
content: Third time, I am writing.Problem:- I have 100 sample data. They must be located 10x10 in XY plane but not exactly square.- Neighborhood must be preserved with every data. Meaning that there shouldn't be any folding.- Any data shouldn't inside of any other data region.What do I have:- Only data coordinates.What did I try:- Calculate their distance and decide are they neighbor or not. It doesn't work.Which idea do I have:Voronoi.At below. There are ten datum. They can split with voronoi but, I am not sure, voronoi is good way for me. Maybe it is stupid idea.

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 01:58:58 am
content: Quote from: Karamel on December 11, 2017, 01:55:04 amWhat does "not exactly square" mean mathematically? Are they still aligned enough that you can assign them to a 10x10 grid locations?If the picture is representative of the actual data, then map it to the 10x10 grid and proceed with advice from reply #1.You are asking us to solve mathematical problem and refuse to supply mathematical definitions for source data.Can you actually provide one full data set?

author: xrunner
author_rank: Super Contributor
timestamp: December 11, 2017, 02:02:46 am
content: Quote from: Karamel on December 11, 2017, 01:55:04 amSo is it the case, that you want to draw a line around each data point, such that each point has an area around it that is themaximumit can have, with respect to every other neighborat the same time also having it's maximum area, and so on? Is that the problem you want to solve?

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 02:04:25 am
content: Okay, let's talk mathematically.Plot these values with Matlab or any other program, you will see any four neighbor is not square, but there is no any folding.I don't know how can I represent it mathematically? Just imagine.-Code:2,326945153004733,19594853070491-1,871016969201363,53911469495653-1,496972786296963,61227250912198-0,8122528169832303,82792629280857-0,1479186091983093,980592977010200,3904610047116423,996670431040630,8846354829774763,892973098633221,418625855931143,700478702243481,944860269516453,500232552896832,128027226554003,46714450605330-2,780203715620392,63403212350418-2,440070134286762,80574834840606-1,756783335493073,19965838279159-0,9578298448198763,52074443618457-0,1820765325749383,736728881034080,4634797632313253,766858622719471,048751447056763,643687975695221,654925444490363,437517347668272,232627639084583,247754924979552,517677734945813,20365705804921-3,306542291022241,88642168618198-2,952781911927291,99444008823907-2,197883654556372,46574309431344-1,249668227560952,94536868995197-0,2656332718004633,287995114263220,5972072179482853,356685461293061,345961472034593,200137826307642,038837953703492,962790925814872,635242277092732,769650092457652,881239243444362,76864007565561-3,739365171526631,02535636078190-3,416013089558231,03028174544308-2,713337699698271,44787495862483-1,665267054271201,99782862591119-0,3688474573919232,470780026026190,8719826779357232,622558640871471,847410703876482,487728947564602,575518201070072,290196905992473,119799712570692,144433945575463,308051481462072,17321217176120-3,879868289257100,0271770496135864-3,58772154035731-0,00312662503954026-3,010461715865510,207825865034808-1,962753150545350,602081400536833-0,3688167057193221,090755677857201,274150887258221,412239563514392,413654150813051,485236890203873,098400511287941,490968602803293,564577056106881,487402356026633,742657057557241,52559093327826-3,64462201092694-1,05977000468018-3,39677180801383-1,07874999347574-2,86680819341489-1,04246063928960-1,82429254380151-0,905207207633807-0,137762310557508-0,5472431074697061,61816140521391-0,04471715031789262,770468936754700,3480897205614313,421335048574680,6340609576039663,862158343520580,8310193670998384,068346903006800,923189211801449-3,21452127783302-2,08999042183416-2,94423661881498-2,07231036318961-2,32478399098324-2,11109321057077-1,24020627495412-2,149795238135100,274664693077160-1,957698792169131,78998366724822-1,421691020067892,84660055164790-0,8308184925357653,50448492247770-0,3163717932079983,965669318490850,09373932436700314,194888953231550,313011549676092-2,66185083527865-2,93965170298760-2,34969683316718-2,86343860765161-1,58825260901408-2,92018735678278-0,522260143514478-3,001683399184770,667309770121411-2,903888137297911,81854359021624-2,473925647209572,73233702766931-1,895331036919503,38234462331372-1,314818507689173,86449854653031-0,7943389911095724,11144103769076-0,427888632314525-2,00539382315959-3,55091946711407-1,69705429505853-3,43677093360340-0,904915502869441-3,461876024121370,0305466579334755-3,508568001591960,944474687567931-3,436161489285531,83575795494745-3,104296196867522,63660425944077-2,609224851069033,25145504193097-2,070827558126363,70563437043324-1,557181149309293,93288485700551-1,13732557886813-1,04661509519607-4,06115243199433-1,18470853275476-3,74662771684467-0,473749811791085-3,734744679708580,334443810077910-3,749197585031281,09949897620091-3,673660965407191,85682170564657-3,411666963487072,57626860496710-2,974295851550033,15288140241824-2,486995439098253,55848249402213-2,008768170602373,68518627149908-1,72471305201884

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 02:46:04 am
content: Is this how your data supposed to look like?

author: hamster_nz
author_rank: Super Contributor
timestamp: December 11, 2017, 02:47:43 am
content: I did plot those points, but could not understand.I think our issue is we have no clear understanding of the concept of "neighbor".To me it is "share a common boundary", which works with shapes, but not a list of points.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 03:38:13 am
content: Quote from: ataradov on December 11, 2017, 02:46:04 amYes. Exactly it is.Quote from: hamster_nz on December 11, 2017, 02:47:43 amTry to give numbers to them on graph. Like this 1-2-3.....98-99-100.You will see that1-2-11-12 are neighbor like rectangular. 2-3-12-13 as well.another example, 78-79-88-89.Now, I need to prove it with mathematically and finally I need to write its code. This is my job. I am just searching a way to solve this problem.

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 03:44:04 am
content: Quote from: Karamel on December 11, 2017, 03:38:13 amCool, can you now paint some clusters on the picture that would show some examples of good and bad neighbors?The way I understand the goal right now, there is no single solution.

author: hamster_nz
author_rank: Super Contributor
timestamp: December 11, 2017, 04:42:42 am
content: Are you wanting to select four points, point, point[x+10], point[x+11], point[x+1] and testing to see if they form a four-sided polygon, with the points run clockwise around the boundary, with no angles > 180 degrees?This is much like back-face culling in computer graphics :https://en.wikipedia.org/wiki/Back-face_culling

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 04:26:34 pm
content: Quote from: ataradov on December 11, 2017, 03:44:04 amI think, we don't talk same language. I have given datum. Please give them numbers with starting first one. 1-2-3-4.....100 and show them with numbers on graph. You will see what I am talking about. In this data set, there is no any problem and this is the problem. I need to prove it with mathematically. This is my fourth time that I am writing my problem.Quote from: hamster_nz on December 11, 2017, 04:42:42 amThey must be create any polygon but shouldn't be any other point inside any each polygon. (folding)

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 04:56:43 pm
content: Quote from: Karamel on December 11, 2017, 04:26:34 pmYou have not given enough information. If you think you have, that's great, but don't expect an answer from us.Quote from: Karamel on December 11, 2017, 04:26:34 pmSo all points in the array are exactly numbered already, and number corresponds to the index, correct? But now what's the goal?There are two situations here. One - calculations are done purely on the indexes, for which we have provided a solution. Second one - calculation involve coordinates, but then it is not clear how to mix indexes. You need to fix one or the other. We can ether check that correctly selected square in the index space corresponds to some geometric configuration in the coordinate space, or check something purely based on the coordinates.Also, can you give some information on the source of the data. It may help with the solution. This looks like a very damaged QAM constellation, but I can't see how your math would be useful for this.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 07:29:01 pm
content: Quote from: ataradov on December 11, 2017, 04:56:43 pmFifth time, I am telling you. Please prove that 1-2-11-12 are neighbor, they represent four cornered polygon and there is no any folding with any other data.And do it for all any other four group data.This is my problem. How can I give you more information than this? What should I say more?

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 07:32:21 pm
content: Quote from: Karamel on December 11, 2017, 07:29:01 pmYou keep using terms that you have not defined. What is the definition of "neighbor" and "folding"?Quote from: Karamel on December 11, 2017, 07:29:01 pmYou can provide actual examples on your actual data sets.But I think I will sit this one out, I spent enough time on this, and you are not providing enough information.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 07:37:43 pm
content: Choose any four group data from this data set. You will see. They will create a polygon and there is no any other data inside of these polygons, okay?I marked red, green and yellow them for you. Even yellow, can you see, they can create any polygon and no folding from any other data.I can't understand what you expect from me. This is my problem and I don't try to find any help, just try to find any idea to love this problem. You don't need to write code or any other things. Just think and imagine for solution.

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 07:41:28 pm
content: Your pictures are not showing, just attach them here.Quote from: Karamel on December 11, 2017, 07:37:43 pm"You will see" is not a rigorous definition.Quote from: Karamel on December 11, 2017, 07:37:43 pmSo you need to check that given 4 points form a polygon that contains no other points from this data set? Then this is trivial, unless you have some speed optimization criteria.

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 07:45:59 pm
content: Can you see?Do you say you can't see images now?

author: xrunner
author_rank: Super Contributor
timestamp: December 11, 2017, 08:01:56 pm
content: Quote from: Karamel on December 11, 2017, 07:37:43 pmNo not OK.That is not true, as you can see in my attachment. You cannot choose "any four" and haveno other datainside of the polygon.

author: hamster_nz
author_rank: Super Contributor
timestamp: December 11, 2017, 08:09:50 pm
content: Quote from: Karamel on December 11, 2017, 07:37:43 pmSo is this black polygon also OK? If not, why not?

author: Karamel
author_rank: Regular Contributor
timestamp: December 11, 2017, 08:13:56 pm
content: You can choose only n, n+1, n+10, n+11 numbered data set.Why don't you try to understand. This data set is okay. Please plot it and give numbers for each data. You can't choose like yours.

author: hamster_nz
author_rank: Super Contributor
timestamp: December 11, 2017, 08:36:24 pm
content: Quote from: Karamel on December 11, 2017, 08:13:56 pmLet me restart your problem for you:- I have a set of 100 (x,y) points, points ... points.- I want to take four points and form a quadrilateral(points points[n+10], points[n+11], points[n+1])this gives 97 possible quadrilaterals, as we do not 'wrap around' from point(99) to point(0).- If any two points neighboring points in a quadrilateral have the same pair of x,y values (i.e. are on top of each other), I want to discard that quadrilateral as it will be a triangle.- I want to then test that if draw the quadrilateral, the points would be visited in a clockwise order, and discard the quadrilateral where that is not true.This is close to to back-face culling. To do this I propose splitting the quadrilateral into two triangles, and testing them (points points[n+10], points[n+11]) and (points[n+11],points[n+1],points). If either of them are drawn counter-clockwise then the quadrilateral should be discarded.- Then, I want to test that no other point falls inside (or on the edge?) of this quadrilateral.Once again splitting into two triangles could help here. testing if a point is in a triangle is relatively easyDoes that describe what you are trying to do?

author: ataradov
author_rank: Super Contributor
timestamp: December 11, 2017, 08:45:00 pm
content: Quote from: Karamel on December 11, 2017, 07:45:59 pmYour original message contained links to some image sharing site or something like this. And they were not working. Don't blame this on me.So the way I understand this thing, you want to test that for any 4 points with coordinates (n, n+1, n+10, n+11) forming a quadrilateral, there are no other points in the quadrilateral? Then it is done by a simple test. Here is one description of the algorithmhttp://demonstrations.wolfram.com/AnEfficientTestForAPointToBeInAConvexPolygon/. you can simplify that, since you always know the number of points.But I don't see how this is anything like the original question. In the original question you yourself have selected a set of points that are not in the format (n, n+1, n+10, n+11) and said that it is not OK. Well, now it is not OK by definition. So what's the problem?

author: DJohn
author_rank: Regular Contributor
timestamp: December 12, 2017, 04:25:39 pm
content: Quote from: Karamel on December 11, 2017, 08:13:56 pmPeople are trying to understand, but you are describing the problem very badly. Looking at your country, I am guessing that English isn't your first language, so I do sympathise. But it's very difficult to understand what you're asking for.This is my best guess of what you are asking:You have the coordinates of 100 points. You want to assign numbers 1 - 100 to them, in such a way that for each n from 1 to 9, 11 to 19, 21 to 29, and so on, the points labelled n, n+1, n+10, n+11 form a convex quadrilateral that contains no other point.If the points had integer coordinates from (0,0) up to (9,9), then this numbering would be easy: from left to right and bottom to top. But you need to solve this problem for any set of points, or be able to say that there is no solution.Is that right? By "no folding", do you mean that the quadrilaterals must be convex?

author: metrologist
author_rank: Super Contributor
timestamp: December 12, 2017, 06:21:38 pm
content: I think he simply means that, taking his first grid example to understand which 4 points would normally be neighbors on that grid, yet in some other arrangement, verify that there are no other points infringing on the boundary of every possible 4-neighboring-point shape (already explained well as the n, n+1, n+10, n+11 set). I do not think the shapes need to be convex.For example, take points:1,2,11,12 and verify that none of the remaining 96 points fall on the area defined by those 4 points.2,3,12,13 and verify that none of the remaining 96 points fall on the area defined by those 4 points.3,4,13,14 and verify that none of the remaining 96 points fall on the area defined by those 4 points.etc...Exclusions:Points 10,11 are not neighbors.Points 20,21 are not neighbors.Points 30,31 are not neighbors.etc...

author: metrologist
author_rank: Super Contributor
timestamp: December 12, 2017, 06:33:46 pm
content: Quote from: Karamel on December 11, 2017, 01:17:30 amThe problem is you are missing one of the neighboring points, so I do not understand your problem example...If my interpretation is correct, I might just take an approach of an if statement on all other non-neighboring points to see if their x value and y value is within the points of the neighboring data set.