CN110569445A - position-based neighbor detection method in social network - Google Patents
position-based neighbor detection method in social network Download PDFInfo
- Publication number
- CN110569445A CN110569445A CN201910808171.XA CN201910808171A CN110569445A CN 110569445 A CN110569445 A CN 110569445A CN 201910808171 A CN201910808171 A CN 201910808171A CN 110569445 A CN110569445 A CN 110569445A
- Authority
- CN
- China
- Prior art keywords
- vertex
- point
- convex polygon
- user
- given
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 18
- 238000000034 method Methods 0.000 claims description 46
- 238000005192 partition Methods 0.000 abstract description 13
- 238000010586 diagram Methods 0.000 description 11
- 238000004364 calculation method Methods 0.000 description 3
- 230000006855 networking Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9536—Search customisation based on social or collaborative filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/01—Social networking
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- Primary Health Care (AREA)
- General Business, Economics & Management (AREA)
- Marketing (AREA)
- Human Resources & Organizations (AREA)
- Economics (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Image Generation (AREA)
- Image Analysis (AREA)
Abstract
the invention discloses a neighbor detection method in a social network based on positions, which is an important problem in the social network service based on the positions. Neighbor detection allows the user to select a particular geometric range on the map and then ask if his friend is within that range. In order to efficiently realize the neighbor detection in the social network, the geometric range selected by a user is abstracted into a convex polygon, the position of a friend of the user is abstracted into a point, then four characteristic vertexes of the convex polygon are extracted, one division of the convex polygon can be realized according to the four characteristic vertexes, then the given point is judged to fall into which partition, the judgment condition corresponding to the partition is called to judge the position relation between the given point and the convex polygon, and the result is finally obtained. The invention can obtain the position relation between the point and the convex polygon only by judging the point and the side once, thereby efficiently solving the problem of neighbor detection in the social network.
Description
Technical Field
the invention belongs to the technical field of social networks, relates to a neighbor detection method in a social network, and particularly relates to a method for performing neighbor detection by using a position relation between a point and a convex polygon in a position-based social network service.
Background
With the popularization of location-aware mobile terminals and the popularization of social applications, location-based social networking services (lbs ns) bring great convenience to the lives of people. Among them, the neighbor detection service is a typical application of the LBS. Neighbor detection allows the user to select a particular geometric range on the map and then ask if his friend is within that range. Generally, a geometric range selected by a user is abstracted into a convex polygon, the position of a friend of the user is abstracted into a point, and the problem of neighbor detection is solved by judging the position relation between the point and the convex polygon.
The current method for judging the point and the convex polygon comprises the following steps: the orientation of the points is calculated (document 1), the ray method (document 2), the included angle method (document 3), the area method (document 4), and the like. In the method for calculating the orientation of the points, the orientation of the points and each side of the convex polygon needs to be judged; in the angle clamping method, the included angle between the point and each side of the convex polygon needs to be calculated; in the area method, the problem of the positions of points and convex polygons needs to be converted into a triangular area problem, and then the triangular area problem is solved, so that the methods generally have the problem of low calculation efficiency. In the ray method, a ray is led out through a given point, the number of intersection points of the ray and a convex polygon is calculated, if the number of the intersection points is an odd number, a coordinate point is in the convex polygon, and otherwise, the coordinate point is outside the convex polygon. However, when the given point is located on the convex polygon side, the method has a possibility of erroneous judgment. Therefore, how to efficiently implement the proximity detection in the social network is still a problem worthy of research.
[1]F.Feito,J.C.Torres,and A.Orientation,simplicity,and inclusion test for planar polygons[J].Comput.Graph.,1995,19(4):595–600.
[2]GALETZKA M,GLAUNER P O.A simple and correct even-odd algorithm for the point-in-polygon problem for complex polygons[OL].In:Proceedings of the12th International Joint Conference on Computer Vision,Imaging andComputer Graphics Theory and Applications(VISIGRAPP 2017).Porto,Portugal,2017:175-178.
[3]HORMANN K,AGATHOS A.The point in polygon problem for arbitrary polygons[J].Computational Geometry,2001,20(3):131-144.
[4] Chenzhuihua, Lishundong, Huangqiong, Donglihong, Chenpidang, two new solutions for the problem of secret position judgment [ J ] reported by computer, 2018,41(2):336-348.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method for performing neighbor detection using a position relationship between a point and a convex polygon in a location-based social networking service.
The technical scheme adopted by the invention is as follows: a neighbor detection method in a social network based on positions is characterized in that a geometric range specified by a user is a convex polygon L with n vertexes, and the geometric range is sequentially numbered anticlockwise from the vertex with the largest ordinate, and is assumed to be { P1,P2,…,PnAre respectively (x) in coordinatesi,yi) I-1, 2, …, n, and represents the location of the user's friend as a point P (x)p,yp) Judging the position relation between the point P and the convex polygon L, namely judging whether the point P is positioned outside or inside the convex polygon L; the point P is positioned inside the convex polygon L and comprises the condition that the point P is positioned on the side of the convex polygon L; if the point P is positioned outside the convex polygon L, the situation that the friends of the user are not in the geometric range specified by the user is shown; if the point P is positioned inside the convex polygon L, the situation that the friend of the user is positioned in the geometric range specified by the user is shown;
characterized in that the method comprises the following steps:
step 1: finding four characteristic vertexes of the convex polygon L: a top vertex, a left vertex, a bottom vertex and a right vertex; the uppermost vertex is marked as P1Let the leftmost vertex be denoted as PlThe lowest vertex is denoted as PdAnd the rightmost vertex is marked as PrIf l is more than or equal to 1 and less than or equal to d and less than or equal to r and less than or equal to n;
Step 2: judging the position relation between the given point P and the convex polygon L;
And step 3: if the point P is inside the convex polygon L, returning that the friend of the user is positioned in the geometric range specified by the user; if the point P is outside the convex polygon L, the friend returning to the user is not within the user-specified geometric range.
preferably, the specific implementation of step 2 comprises the following sub-steps:
step 2.1: if y isp<ydOr yp>y1Or xp<xlOr xp>xrThen, given point P (x)p,yp) The flow is finished when the convex polygon L is positioned outside the convex polygon L;
Otherwise, entering step 2.2;
step 2.2: if xp≤x1and y isp≥ylAt this time, the given point P (x)p,yp) At the uppermost vertex P1Left and leftmost vertex PlAt this time, the judgment process I is executed, and the process is ended;
Otherwise, entering step 2.3;
The specific implementation of the judgment process I comprises the following sub-steps:
Step 2.2.1: at the vertex { P1,P2,…,PlFind two adjacent vertexes PiAnd Pi+1So that x isi≤x≤xi+1Wherein i is more than or equal to 1 and less than or equal to l-1;
Step 2.2.2: computing over-vertex Piand Pi+1Straight line of (2), with the symbol f1(x) Represents the straight line;
Step 2.2.3: if y isp≤f1(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Located outside the convex polygon L;
Step 2.3: if xp≤xdAnd y isp<ylAt this time, the given point P (x)p,yp) At the lowest vertex PdLeft and leftmost vertex PlAt this time, the judgment process II is executed, and the process is ended;
Otherwise, entering step 2.4;
The specific implementation of the judgment process II comprises the following substeps:
Step 2.3.1: at the vertex { Pl,Pl+1,Pl+2,…,Pdfind two adjacent vertexes PiAnd Pi+1so that x isi+1≤x≤xiWherein l-1 is more than or equal to i is more than or equal to d;
Step 2.3.2: computing over-vertex PiAnd Pi+1straight line of (2), with the symbol f2(x) Represents the straight line;
Step 2.3.3: if y isp≥f2(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Located outside the convex polygon L;
Step 2.4: if xp>xdAnd y isp<yrAt this time, the given point P (x)p,yp) At the lowest vertex Pdright side and rightmost vertex P ofrAt this time, the judgment process III is executed, and the process is ended;
Otherwise, entering step 2.5;
the specific implementation of the judgment process III includes the following substeps:
Step 2.4.1: at the vertex { Pd,Pd+1,Pd+2,…,PrFind two adjacent vertexes PiAnd Pi+1So that x isi≤x≤xi+1Wherein d is not less than i and not more than r-1;
Step 2.4.2: computing over-vertex PiAnd Pi+1straight line of (2), with the symbol f3(x) Represents the straight line;
step 2.4.3: if y isp≥f3(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Located outside the convex polygon L;
step 2.5: if xp>x1And y isp≥yrAt this time, the given point P (x)p,yp) At the uppermost vertex P1Right side and rightmost vertex P ofrAt this time, the judgment process IV is executed, and the process is ended;
The specific implementation of the judgment process IV includes the following substeps:
Step 2.5.1: if x1≤x≤xnselecting the vertex PnAnd P1Otherwise at vertex { Pr,Pr+1,Pr+2,…,PnFind two adjacent vertexes PiAnd Pi+1So that x isi+1≤x≤xiWherein r-1 is not less than i and not more than n;
Step 2.5.2: if the selected vertex is Pnand P1Then the vertex P is calculatednAnd P1Otherwise, the vertex P is calculatediand Pi+1Straight line of (2), with the symbol f4(x) Representing the calculated straight line;
Step 2.5.3: if y isp≤f4(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Outside the convex polygon L.
Aiming at the problems of low calculation cost and low efficiency of the existing method, the invention discloses a neighbor detection method in a social network based on position; abstracting a geometric range selected by a user into a convex polygon, abstracting the position of friends of the user into a point, extracting four characteristic vertexes of the convex polygon, dividing the convex polygon according to the four characteristic vertexes, and giving a position judgment process of an inner point of each partition and the convex polygon; and finally, judging which partition the point falls into according to the coordinates of the given point, and then executing a corresponding position judgment process to finally obtain a solution of the problem. In the method provided by the invention, the given point does not need to carry out position judgment on all sides of the convex polygon and problem conversion, so that the calculation expense is greatly reduced.
Drawings
FIG. 1: a convex polygon is given according to the embodiment of the invention;
FIG. 2: the given convex polygon of the embodiment of the invention is divided into schematic diagrams;
FIG. 3: a method flow diagram of an embodiment of the invention;
FIG. 4: the schematic diagram of the position relation between the first point and the given convex polygon in the embodiment of the invention;
FIG. 5: the schematic diagram of the position relationship between the second point and the given convex polygon in the embodiment of the invention;
FIG. 6: a schematic diagram of a positional relationship between a third point and a given convex polygon in the embodiment of the present invention;
FIG. 7: a schematic diagram of a position relationship between a fourth point and a given convex polygon in the embodiment of the present invention;
FIG. 8: a schematic diagram of a position relationship between a fifth point and a given convex polygon in the embodiment of the invention;
FIG. 9: a schematic diagram of a position relationship between a sixth point and a given convex polygon in the embodiment of the present invention;
FIG. 10: a schematic diagram of a position relationship between a seventh point and a given convex polygon in the embodiment of the present invention;
FIG. 11: a schematic diagram of a positional relationship between an eighth point and a given convex polygon in the embodiment of the present invention;
FIG. 12: the ninth point of the embodiment of the invention is a schematic diagram of the position relation of a given convex polygon.
Detailed description of the invention
In order to facilitate the understanding and implementation of the present invention for those of ordinary skill in the art, the present invention is further described in detail with reference to the accompanying drawings and examples, it is to be understood that the embodiments described herein are merely illustrative and explanatory of the present invention and are not restrictive thereof.
Referring to FIG. 1, assume that the geometric range specified by the user is a convex polygon L having n vertices, which are numbered counterclockwise in order from the vertex with the largest ordinate, and are assumed to be { P1,P2,…,PnAre respectively (x) in coordinatesi,yi),i=1,2, …, n. Wherein four characteristic vertexes are P1(uppermost vertex), Pl(leftmost vertex), Pd(lowest vertex), Pr(rightmost vertex).
Referring to fig. 2, the position of the friend of the user is represented as a point P, and a convex polygon is divided according to four feature vertices, so as to obtain 5 partitions: the first partition corresponds to the blank area in fig. 2, and if the point P falls into this area, it is indicated that the point P is outside the convex polygon (see fig. 4); the second partition corresponds to the shaded area labeled I in fig. 2, and if the point P falls into this area, it needs to further judge its positional relationship with the convex polygon (see fig. 5 and 6); the third partition corresponds to the shaded area labeled II in fig. 2, and if the point P falls into this area, it needs to further judge its positional relationship with the convex polygon (see fig. 7 and 8); the fourth partition corresponds to the shaded area labeled III in fig. 2, and if the point P falls into this area, it needs to further judge its positional relationship with the convex polygon (see fig. 9 and 10); the fifth partition corresponds to the shaded area labeled IV in fig. 2, and if the point P falls into this area, it needs to be further judged as to its positional relationship with the convex polygon (see fig. 11 and 12).
Referring to fig. 3, the method for detecting a neighbor in a social network based on a location provided by the present invention includes the following steps:
step 1: finding four characteristic vertexes of the convex polygon L: uppermost vertex, leftmost vertex, lowermost vertex, and rightmost vertex. According to the above numbering rule, the uppermost vertex is P1Let P be the leftmost vertexlThe lowest vertex is PdThe rightmost vertex is PrAnd d is more than or equal to 1 and less than or equal to r and less than or equal to n. One division of the convex polygon is actually realized on the basis of four feature vertices, see fig. 2, where a given convex polygon is divided into 5 partitions.
step 2: the positional relationship between the predetermined point P and the convex polygon L is determined.
Referring to steps 2.1 to 2.5 in fig. 3 and fig. 4 to 12, the specific implementation of step 2 includes the following sub-steps:
Step 2.1: if y isp<ydOr yp>y1Or xp<xlOr xp>xri.e. point P (x)p,yp) Falls into the blank region (corresponding to the case shown in FIG. 4), a point P (x) is givenp,yp) The convex polygon L is positioned outside the convex polygon L, otherwise, the step 2.2 is carried out;
Step 2.2: if xp≤x1and y isp≥ylI.e. point P (x)p,yp) Falls into region I, at which point the following steps 2.2.1 to 2.2.3 are performed, otherwise step 2.3 is entered.
step 2.2.1: at the vertex { P1,P2,…,PlFind two adjacent vertexes PiAnd Pi+1So that x isi≤x≤xi+1wherein i is more than or equal to 1 and less than or equal to l-1;
Step 2.2.2: computing over-vertex PiAnd Pi+1Straight line of (2), with the symbol f1(x) Represents the straight line;
Step 2.2.3: if y isp≤f1(xp) (corresponding to the case shown in FIG. 5), the point P (x) is givenp,yp) Is located inside the convex polygon L, otherwise (corresponding to the situation shown in FIG. 6) a given point P (x)p,yp) Outside the convex polygon L.
Step 2.3: if xp≤xdAnd y isp<ylI.e. point P (x)p,yp) Falls into region II, at which point the following steps 2.3.1 to 2.3.3 are performed, otherwise step 2.4 is entered.
step 2.3.1: at the vertex { Pl,Pl+1,Pl+2,…,PdFind two adjacent vertexes PiAnd Pi+1so that x isi+1≤x≤xiWherein l-1 is more than or equal to i is more than or equal to d;
Step 2.3.2: computing over-vertex PiAnd Pi+1Straight line of (2), with the symbol f2(x) Represents the straight line;
Step 2.3.3: if y isp≥f2(xp) (corresponding to the case shown in FIG. 7), the point P (x) is givenp,yp) Is located inside the convex polygon L, otherwise (corresponding to the situation shown in FIG. 8) a given point P (x)p,yp) Outside the convex polygon L.
step 2.4: if xp>xdAnd y isp<yrI.e. point P (x)p,yp) Falls into region III, at which point the following steps 2.4.1 to 2.4.3 are performed, otherwise step 2.5 is entered.
Step 2.4.1: at the vertex { Pd,Pd+1,Pd+2,…,PrFind two adjacent vertexes PiAnd Pi+1So that x isi≤x≤xi+1Wherein d is not less than i and not more than r-1;
Step 2.4.2: computing over-vertex PiAnd Pi+1Straight line of (2), with the symbol f3(x) Represents the straight line;
Step 2.4.3: if y isp≥f3(xp) (corresponding to the case shown in FIG. 9), the point P (x) is givenp,yp) Is located inside the convex polygon L, otherwise (corresponding to the situation shown in FIG. 10) a given point P (x)p,yp) Outside the convex polygon L.
step 2.5: at this time xp>x1And y isp≥yri.e. point P (x)p,yp) Falling within region IV, the following steps 2.5.1 to 2.5.3 are performed.
Step 2.5.1: if x1≤x≤xnSelecting the vertex PnAnd P1otherwise at vertex { Pr,Pr+1,Pr+2,…,PnFind two adjacent vertexes PiAnd Pi+1So that x isi+1≤x≤xiWherein r-1 is not less than i and not more than n;
Step 2.5.2: if the selected vertex is PnAnd P1Then the vertex P is calculatednAnd P1Otherwise, the vertex P is calculatediAnd Pi+1Straight line of (2), with the symbol f4(x) Representing the calculated straight line;
Step 2.5.3: if y isp≤f4(xp) (corresponding to FIG. 1)1), point P (x) is givenp,yp) Is located inside the convex polygon L, otherwise (corresponding to the situation shown in FIG. 12) a given point P (x)p,yp) Outside the convex polygon L.
And step 3: if the point P is inside the convex polygon L, returning that the friend of the user is positioned in the geometric range specified by the user; if the point P is outside the convex polygon L, the friend returning to the user is not within the user-specified geometric range.
Aiming at the problem of neighbor detection in a social network, firstly abstracting a geometric range selected by a user into a convex polygon, abstracting the position of friends of the user into a point, then extracting four characteristic vertexes of the convex polygon, dividing the convex polygon according to the four characteristic vertexes, and giving a position judgment process of an inner point of each partition and the convex polygon; and finally, judging which partition the point falls into according to the coordinates of the given point, and then executing a corresponding position judgment process to finally obtain a solution of the problem. The invention can obtain the position relation between the point and the convex polygon only by judging the point and the side once, thereby efficiently solving the problem of neighbor detection in the social network.
It should be understood that parts of the specification not set forth in detail are well within the prior art.
It should be understood that the above description of the preferred embodiments is given for clarity and not for any purpose of limitation, and that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (2)
1. A neighbor detection method in a social network based on positions is characterized in that a geometric range specified by a user is a convex polygon L with n vertexes, and the geometric range is sequentially numbered anticlockwise from the vertex with the largest ordinate, and is assumed to be { P1,P2,…,PnAre respectively (x) in coordinatesi,yi),i1,2, …, n, and represents the location of the user's friend as a point P (x)p,yp) Judging the position relation between the point P and the convex polygon L, namely judging whether the point P is positioned outside or inside the convex polygon L; the point P is positioned inside the convex polygon L and comprises the condition that the point P is positioned on the side of the convex polygon L; if the point P is positioned outside the convex polygon L, the situation that the friends of the user are not in the geometric range specified by the user is shown; if the point P is positioned inside the convex polygon L, the situation that the friend of the user is positioned in the geometric range specified by the user is shown;
Characterized in that the method comprises the following steps:
Step 1: finding four characteristic vertexes of the convex polygon L: a top vertex, a left vertex, a bottom vertex and a right vertex; the uppermost vertex is marked as P1Let the leftmost vertex be denoted as Plthe lowest vertex is denoted as PdAnd the rightmost vertex is marked as PrIf l is more than or equal to 1 and less than or equal to d and less than or equal to r and less than or equal to n;
step 2: judging the position relation between the given point P and the convex polygon L;
And step 3: if the point P is inside the convex polygon L, returning that the friend of the user is positioned in the geometric range specified by the user; if the point P is outside the convex polygon L, the friend returning to the user is not within the user-specified geometric range.
2. The method for detecting the nearest neighbor in the social network based on the position as claimed in claim 1, wherein the step 2 comprises the following steps:
step 2.1: if y isp<ydOr yp>y1Or xp<xlOr xp>xrThen, given point P (x)p,yp) The flow is finished when the convex polygon L is positioned outside the convex polygon L;
Otherwise, entering step 2.2;
step 2.2: if xp≤x1And y isp≥ylat this time, the given point P (x)p,yp) At the uppermost vertex P1Left and leftmost vertex PlAt this time, the judgment is performedprocess I, the process is finished;
Otherwise, entering step 2.3;
The specific implementation of the judgment process I comprises the following sub-steps:
Step 2.2.1: at the vertex { P1,P2,…,PlFind two adjacent vertexes Piand Pi+1So that x isi≤x≤xi+1Wherein i is more than or equal to 1 and less than or equal to l-1;
Step 2.2.2: computing over-vertex PiAnd Pi+1Straight line of (2), with the symbol f1(x) Represents the straight line;
step 2.2.3: if y isp≤f1(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Located outside the convex polygon L;
Step 2.3: if xp≤xdAnd y isp<ylat this time, the given point P (x)p,yp) At the lowest vertex PdLeft and leftmost vertex PlAt this time, the judgment process II is executed, and the process is ended;
otherwise, entering step 2.4;
The specific implementation of the judgment process II comprises the following substeps:
step 2.3.1: at the vertex { Pl,Pl+1,Pl+2,…,Pdfind two adjacent vertexes PiAnd Pi+1so that x isi+1≤x≤xiwherein l-1 is more than or equal to i is more than or equal to d;
Step 2.3.2: computing over-vertex Piand Pi+1Straight line of (2), with the symbol f2(x) Represents the straight line;
Step 2.3.3: if y isp≥f2(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Located outside the convex polygon L;
Step 2.4: if xp>xdAnd y isp<yrAt this time, the given point P (x)p,yp) At the lowest vertex PdRight side and rightmost vertex P ofrAt this time, the judgment process III is executed, and the process is ended;
Otherwise, entering step 2.5;
The specific implementation of the judgment process III includes the following substeps:
step 2.4.1: at the vertex { Pd,Pd+1,Pd+2,…,PrFind two adjacent vertexes PiAnd Pi+1So that x isi≤x≤xi+1Wherein d is not less than i and not more than r-1;
Step 2.4.2: computing over-vertex Piand Pi+1Straight line of (2), with the symbol f3(x) Represents the straight line;
step 2.4.3: if y isp≥f3(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Located outside the convex polygon L;
Step 2.5: if xp>x1and y isp≥yrat this time, the given point P (x)p,yp) At the uppermost vertex P1right side and rightmost vertex P ofrAt this time, the judgment process IV is executed, and the process is ended;
The specific implementation of the judgment process IV includes the following substeps:
step 2.5.1: if x1≤x≤xnSelecting the vertex PnAnd P1Otherwise at vertex { Pr,Pr+1,Pr+2,…,Pnfind two adjacent vertexes PiAnd Pi+1So that x isi+1≤x≤xiwherein r-1 is not less than i and not more than n;
Step 2.5.2: if the selected vertex is PnAnd P1Then the vertex P is calculatednand P1Otherwise, the vertex P is calculatediAnd Pi+1Straight line of (2), with the symbol f4(x) Representing the calculated straight line;
Step 2.5.3: if y isp≤f4(xp) Then, given point P (x)p,yp) Located inside the convex polygon L, otherwise given a point P (x)p,yp) Outside the convex polygon L.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910808171.XA CN110569445B (en) | 2019-08-29 | 2019-08-29 | Neighbor detection method in social network based on position |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910808171.XA CN110569445B (en) | 2019-08-29 | 2019-08-29 | Neighbor detection method in social network based on position |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110569445A true CN110569445A (en) | 2019-12-13 |
CN110569445B CN110569445B (en) | 2023-06-02 |
Family
ID=68776700
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910808171.XA Active CN110569445B (en) | 2019-08-29 | 2019-08-29 | Neighbor detection method in social network based on position |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110569445B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112509031A (en) * | 2020-12-02 | 2021-03-16 | 湖北工业大学 | Position judging method |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101114379A (en) * | 2007-09-07 | 2008-01-30 | 中国科学院软件研究所 | Method for judging point whether or not situated in polygon |
US20100017126A1 (en) * | 2008-07-16 | 2010-01-21 | Qualcomm Incorporated | Method for dynamic creation of a geofence in a wireless system |
CN102063493A (en) * | 2010-12-30 | 2011-05-18 | 北京大学 | Content extraction method based on regular expression group and control logic |
US20110320319A1 (en) * | 2010-06-23 | 2011-12-29 | Justin Streich | Methods, Systems and Machines for Identifying Geospatial Compatibility Between Consumers and Providers of Goods or Services |
CN102982562A (en) * | 2012-10-19 | 2013-03-20 | 浙江中正智能科技有限公司 | Method for judging whether target point is positioned inside polygon area |
CN104123737A (en) * | 2014-07-15 | 2014-10-29 | 沈颖 | Testing method for judging inclusivity of points on inner portion, outer portion or boundary of polygonal area |
CN105869188A (en) * | 2016-04-22 | 2016-08-17 | 广州日滨科技发展有限公司 | Detection method and system for point to polygon position relation |
CN106878941A (en) * | 2016-12-29 | 2017-06-20 | 贵州财富之舟科技有限公司 | position reminding method and device |
CN108269283A (en) * | 2017-12-26 | 2018-07-10 | 武汉长江通信智联技术有限公司 | A kind of implementation method for judging transfer point disengaging polygonal region |
CN108777839A (en) * | 2018-05-25 | 2018-11-09 | 湖北工业大学 | The positioning of secret protection is registered system and method in a kind of mobile Internet |
CN109934890A (en) * | 2019-03-08 | 2019-06-25 | 南京泛在地理信息产业研究院有限公司 | A kind of meander envelope extraction method |
-
2019
- 2019-08-29 CN CN201910808171.XA patent/CN110569445B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101114379A (en) * | 2007-09-07 | 2008-01-30 | 中国科学院软件研究所 | Method for judging point whether or not situated in polygon |
US20100017126A1 (en) * | 2008-07-16 | 2010-01-21 | Qualcomm Incorporated | Method for dynamic creation of a geofence in a wireless system |
US20110320319A1 (en) * | 2010-06-23 | 2011-12-29 | Justin Streich | Methods, Systems and Machines for Identifying Geospatial Compatibility Between Consumers and Providers of Goods or Services |
CN102063493A (en) * | 2010-12-30 | 2011-05-18 | 北京大学 | Content extraction method based on regular expression group and control logic |
CN102982562A (en) * | 2012-10-19 | 2013-03-20 | 浙江中正智能科技有限公司 | Method for judging whether target point is positioned inside polygon area |
CN104123737A (en) * | 2014-07-15 | 2014-10-29 | 沈颖 | Testing method for judging inclusivity of points on inner portion, outer portion or boundary of polygonal area |
CN105869188A (en) * | 2016-04-22 | 2016-08-17 | 广州日滨科技发展有限公司 | Detection method and system for point to polygon position relation |
CN106878941A (en) * | 2016-12-29 | 2017-06-20 | 贵州财富之舟科技有限公司 | position reminding method and device |
CN108269283A (en) * | 2017-12-26 | 2018-07-10 | 武汉长江通信智联技术有限公司 | A kind of implementation method for judging transfer point disengaging polygonal region |
CN108777839A (en) * | 2018-05-25 | 2018-11-09 | 湖北工业大学 | The positioning of secret protection is registered system and method in a kind of mobile Internet |
CN109934890A (en) * | 2019-03-08 | 2019-06-25 | 南京泛在地理信息产业研究院有限公司 | A kind of meander envelope extraction method |
Non-Patent Citations (2)
Title |
---|
沈华;张明武;: "一种隐私保护的智能电网多级用户电量聚合控制方案", 密码学报 * |
郝建强;宫云战;叶红;: "点对多边形位置检测的稳定串行最优与并行的算法", 计算机应用研究 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112509031A (en) * | 2020-12-02 | 2021-03-16 | 湖北工业大学 | Position judging method |
CN112509031B (en) * | 2020-12-02 | 2022-08-16 | 湖北工业大学 | Position judging method |
Also Published As
Publication number | Publication date |
---|---|
CN110569445B (en) | 2023-06-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111504325B (en) | Global path planning method based on weighted A-algorithm of enlarged search neighborhood | |
CN111540005B (en) | Loop detection method based on two-dimensional grid map | |
CN102890703B (en) | A kind of heterogeneous multidimensional scaling method of network | |
WO2009064779A2 (en) | Tiled projections for planar processing of round earth data | |
WO2021068346A1 (en) | Method and device for location querying based on geohash algorithm, computer device, and storage medium | |
CN111369539B (en) | Building facade window detecting system based on multi-feature image fusion | |
Feng et al. | Unknown hostile environment-oriented autonomous WSN deployment using a mobile robot | |
CN103559209B (en) | A kind of efficient spatial K-NN search method that Voronoi Diagram is combined with virtual grid | |
CN110569445A (en) | position-based neighbor detection method in social network | |
CN106470435B (en) | The method and system of identification WiFi groups | |
CN103778191A (en) | Vector contour line data partitioning method with space proximity relation considered | |
CN106340046B (en) | A kind of radar target position analysis method based on image conversion geography information | |
Ai et al. | A map generalization model based on algebra mapping transformation | |
CN106802958A (en) | Conversion method and system of the CAD data to GIS data | |
CN114003623A (en) | Similar path typhoon retrieval method | |
CN103106353A (en) | Construction method of fingerprint feature curve of genomic sequence | |
CN105764088B (en) | A kind of TDOA honeycomb locating method based on genetic algorithm | |
CN108269283A (en) | A kind of implementation method for judging transfer point disengaging polygonal region | |
CN107464272A (en) | The interpolation method of central diffusion type meteorological causes isopleth based on key point | |
CN104765820B (en) | A kind of service dependence of non-intrusion type finds method | |
CN110351657A (en) | A kind of method of wireless sensor network interior joint geometry location | |
CN113487858B (en) | Road network data-oriented abnormal track detection method | |
CN110763223B (en) | Sliding window based indoor three-dimensional grid map feature point extraction method | |
Liu et al. | Connectivity-based and boundary-free skeleton extraction in sensor networks | |
CN112509031B (en) | Position judging method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |