CN102012782B - Method and system for judging dragged moving direction - Google Patents

Method and system for judging dragged moving direction Download PDF

Info

Publication number
CN102012782B
CN102012782B CN2010102854836A CN201010285483A CN102012782B CN 102012782 B CN102012782 B CN 102012782B CN 2010102854836 A CN2010102854836 A CN 2010102854836A CN 201010285483 A CN201010285483 A CN 201010285483A CN 102012782 B CN102012782 B CN 102012782B
Authority
CN
China
Prior art keywords
terminal point
starting point
line
point
shift
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.)
Expired - Fee Related
Application number
CN2010102854836A
Other languages
Chinese (zh)
Other versions
CN102012782A (en
Inventor
宋叶祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
World (Shanghai) Technology Development Co., Ltd.
Original Assignee
Shenzhen Temobi Science and Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Temobi Science and Technology Co Ltd filed Critical Shenzhen Temobi Science and Technology Co Ltd
Priority to CN2010102854836A priority Critical patent/CN102012782B/en
Publication of CN102012782A publication Critical patent/CN102012782A/en
Priority to PCT/CN2011/076161 priority patent/WO2012034432A1/en
Priority to HK11110077.2A priority patent/HK1155829A1/en
Application granted granted Critical
Publication of CN102012782B publication Critical patent/CN102012782B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)
  • Navigation (AREA)

Abstract

The invention discloses a method and system for judging a dragged moving direction, which are used for judging the dragged moving direction by using n directions, wherein 2n included angles are contained, the judging error on the dragged moving direction is within an included angle of 360 degrees/2n, the n can be infinitely expanded, and the larger the n is, the error is smaller and the dragged moving direction is more accurate. The method comprises the following steps of: calculating the tangent value of coordinate offset, and then comparing the tangent value with a value in a tangent table, thereby determining the dragged moving direction. The method has favorable expansibility and generality, and can be used for accurately judge the dragged moving direction.

Description

A kind of method and system of shifting to judgement that drags
Technical field
The present invention relates to drag the field of shifting to, relate in particular to a kind of method and system of shifting to judgement that drags.
Background technology
When the terminal platform user drags to from certain point the concrete picture that another puts to check this some zone on a picture, usually need judgement drag moving direction, obtain and change picture according to moving direction and side-play amount size.In prior art, generally realize the movement of 4 directions (upper and lower, left and right), namely change in coordinate axis direction, as shown in Figure 1, now do 2 deciles with 4 angles of coordinate axis formation, and namely straight line AB, CD, dot.The user drags from the O point and shifts to another point and drop on straight line AB and the formed angle of CD the inside.In straight line AB and the formed included angle A OC of CD, judge that dragging moving direction is make progress (being ray OE), the like, judge in included angle B OD and drag moving direction (being ray OF) downwards, judge moving direction (being ray OG) left in angle COB, judge moving direction (being ray OH) to the right in included angle A OD.This is general way, obvious this decision method is not accurate enough, more rough, for example, (coordinate is (x2 when the user moves to the P point by initial point O (coordinate is (x1, y1)), y2)), shown in blue beam OP, the method is classified as moving direction and has moved up, and this direction is more prone to oblique upper right side to OA(angle 45 degree in fact).This scheme realizes technically, general zone of adopting trigonometric function specifically to judge another drop point P place, usually adopt tan, judge by slope, feasible a kind of algorithm is: first general judgement is to X, the moving direction of y-axis shift, compare the side-play amount of X and Y coordinates, the Rule of judgment that makes progress such as direction is y2 again〉y1﹠amp; ﹠amp; | y2-y1〉| x2-x1|, y2 wherein〉y1, defining moving direction is the above direction of X-axis, comprise that angle GOC(represents that direction is left), included angle A OC(represents that direction upwards), right included angle A OH(represents that direction to the right), pass through again afterwards condition | y2-y1|〉| x2-x1| judges that the P point drops in included angle A OC, because the absolute value of ray OP slope is exactly that the P point drops on ray OA or OC greater than 1(critical condition, this moment slope absolute value be 1, with the X-axis angle be 45 the degree or 135 the degree).Can analogize the condition of other three directions by similar approach.
The shortcoming of prior art scheme:
Can be used for judging that to drag the direction quantity of shifting to few, and need judgement more multi-direction in usually using, and direction is less, mobile effect is poorer, drags that to shift to error obvious; The extendability of the algorithm of prior art is not strong, does not possess retractility, and at some terminal platform, under CLDC in Java ME 1.0 configuration, floating point arithmetic do not supporting under specific configuration surroundings, and versatility is not strong.
Summary of the invention
The purpose of the embodiment of the present invention is to propose a kind of method and system of shifting to judgement that drags, and is intended to solve judge in prior art that the quantity that drags the direction of shifting to is few, error large, it is slow to refresh, problem difficult expansion.
The embodiment of the present invention is achieved in that a kind of method of shifting to judgement that drags, and comprises the following steps:
Self-defined tangent table assignment;
Triggering drags the request of shifting to, and determines starting point and terminal point;
Minute angles such as described each n are halved again, formed minute angles such as n of second;
Whether judgement drags and shifts to is that 4 change in coordinate axis direction overlap;
If so, drag the direction of shifting to and be one of them change in coordinate axis direction;
If not, determine to drag and shift to the place quadrant;
Determine to drag with respect to the tangent value of origin side-play amount and the numerical value in self-defined tangent table the direction of shifting to according to terminal point coordinate, specifically comprise:
As Guo ⊿ X〉0 Qie ⊿ Y〉0, the line of starting point and terminal point is at first quartile, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis positive dirction;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the first quartile diagonal;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis positive dirction.
Qi Zhong ⊿ X, ⊿ Y is that terminal point is with respect to the side-play amount of starting point on X-axis, Y-axis; TanTable[0], tanTable[1] represent each angle tangent value K doubly; ﹠amp; ﹠amp; Represent that former and later two conditions must all satisfy; K is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
Another purpose of the embodiment of the present invention is to propose a kind of judgement and drags the system that shifts to, and described system comprises: tangent table initial module, coordinate processing module, quadrant judge module, shift to judge module;
Tangent table initial module, with the coordinate processing module with shift to judge module and be connected, be used for receiving and shifting to the request that judge module obtains tangent value, and send qualified tangent value to shifting to judge module according to judging the quantity that drags the direction of shifting to tangent table assignment;
The coordinate processing module is connected with the quadrant judge module with tangent table initial module, be used for to trigger to drag the request of shifting to, and determines to drag to shift to starting point and terminal point coordinate;
The quadrant judge module, with the coordinate processing module with shift to judge module and be connected, be used for the place quadrant of shifting to that drags that judgement coordinate processing module triggers, and request is shifted to judge module and is shifted to the place quadrant and drag the judgement of shifting to according to dragging;
Shift to judge module, be connected with tangent table initial module with the quadrant judge module, be used for receiving the result that drags the concrete quadrant in place of shifting to that the quadrant judge module is sent, k doubly amplifies terminal point coordinate with respect to the tangent value of the side-play amount of origin, contrast one by one with each tangent value of tangent table initial module and determine to drag the direction of shifting to, the process of determining to drag the direction of shifting to comprises:
As Guo ⊿ X〉0 Qie ⊿ Y〉0, the line of starting point and terminal point is at first quartile, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis positive dirction;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the first quartile diagonal;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis positive dirction.
Qi Zhong ⊿ X, ⊿ Y is that terminal point is with respect to the side-play amount of starting point on X-axis, Y-axis; TanTable[0], tanTable[1] represent each angle tangent value K doubly; ﹠amp; ﹠amp; Represent that former and later two conditions must all satisfy; K is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
Beneficial effect of the present invention:
Judge to drag by n direction in the embodiment of the present invention and shift to, wherein be divided into and be 2n angle, drag and shift to error in judgement (n can infinitely great expand in 360 °/2n angle, n is larger, error is less), the tangent value of calculating terminal point coordinate side-play amount, again with the tangent table in value compare, thereby determine mobile direction; In the system or equipment of not supporting floating point arithmetic, tangent value is infinitely amplified; The present invention supports all systems and equipment, favorable expandability, and the judgement moving direction is accurate, error is little, and accuracy rate is higher, refreshes fast.
Description of drawings
Fig. 1 is that the prior art judgement drags the method schematic diagram of shifting to;
Fig. 2 is that a kind of judgement of the embodiment of the present invention drags the method flow diagram of shifting to;
Fig. 3 is that 8 direction judgements of the embodiment of the present invention drag the method schematic diagram of shifting to;
Fig. 4 is that a kind of judgement of the embodiment of the present invention drags the system construction drawing of shifting to.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated, for convenience of explanation, only show the part relevant to the embodiment of the present invention.Should be appreciated that the specific embodiment that this place is described, only be used for explaining the present invention, not in order to limit the present invention.
The present invention is by determining to judge the quantity that drags the direction of shifting to, self-defined tangent table is carried out assignment, when dragging, triggering shifts to when request, determine starting point and terminal point, take starting point as initial point, determine horizontal X axle and vertical Y axle, begin to be divided into n angle around initial point as a limit take initial point and horizontal X axle, form altogether n bar limit, every limit is one and shifts to, again each angle is halved, formed minute angles such as second n, determine to drag according to the tan of the side-play amount of the relative starting point of terminal point and the numerical value in self-defined tangent table the direction of shifting to.
Embodiment one
Fig. 2 is that a kind of judgement of the embodiment of the present invention drags the method flow diagram of shifting to.Described method comprises the following steps:
S201, self-defined tangent table assignment;
Drag the quantity n(n of the direction of shifting to>=2 according to judgement), determine the assignment of tangent table, understand for convenient herein, the explanation as an example of 8 directions example, as shown in Figure 4, tanTable={k*tan22.5 °, k*tan67.5 ° }, wherein tanTable is the tangent table, and 22.5 ° are 360 ° and are divided into the number of degrees that 16 grades are divided angle, 67.5 ° be one 16 grade divide angle and one 8 etc. divide angle and; Wherein k is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool;
Can adopt equally cotangent, sine, cosine, secant, cosecant trigonometric function method to realize the assignment of cotangent table, sine table, cosine table, secant table, cosecant table, specific algorithm is similar, does not do narration one by one here;
S202 triggers and drags the request of shifting to, and determines starting point and terminal point;
Explanation, as shown in Figure 3, drag to P from O as an example of 8 directions example, forms straight line OP, and O is starting point, and P is terminal point, and wherein OP can be any one direction, and this OP position of sentencing Fig. 4 is example, and the OP position is first quartile;
S203 take starting point as initial point, determines horizontal X axle and vertical Y axle;
S204 begins take the horizontal X axle as a limit to be divided into n etc. minute angle around initial point, and the n bar limit that forms altogether is as n mobile direction;
The explanation as an example of 8 directions example as shown in Figure 4, forms altogether 8 grades and divides angle to be: BOA, AOH, HOG, GOF, FOE, EOD, DOC, COB, and wherein 8 limit OA, OH, OG, OF, OE, OD, OC, OB drag the direction of shifting to;
S205 halves to minute angles such as described each n again, forms minute angles such as n of second;
Take 8 directions as the example explanation, as shown in Figure 4, forming altogether second 8 grade divides angle to be: IOJ, JOK, KOL, LOM, MON, NOQ, QOR, ROI, and wherein, OP falls into second 8 grade, and to divide the direction of shifting to that drags after angle be respectively OJ, OI, OR, OQ, ON, OM, OL, OK;
S206, whether judgement drags and shifts to is that 4 change in coordinate axis direction overlap;
The value of Gen Ju ⊿ X, ⊿ Y judges that OP dragging on coordinate axis shift to, and Qi Zhong ⊿ X, ⊿ Y is that the P point is with respect to the coordinate offset amount of starting point O;
S207 if so, drags to shift to and is one of them change in coordinate axis direction;
The explanation as an example of 8 directions example, as shown in Figure 4, determination methods is:
As Guo ⊿ X=0 Qie ⊿ Y〉0, OP's drags to shift to and is OH;
As Guo ⊿ X=0 Qie ⊿ Y<0, OP's drags to shift to and is OD;
As Guo ⊿ X〉0 Qie ⊿ Y=0: OP's drags to shift to and is OB;
As Guo ⊿ X<0 Qie ⊿ Y=0, OP's drags to shift to and is OF;
S208 if not, determines to drag and shifts to the place quadrant;
S209 determines to drag according to the tangent value of terminal point coordinate side-play amount and the numerical value in self-defined tangent table the direction of shifting to;
The explanation as an example of 8 directions example, as shown in Figure 4:
As Guo ⊿ X〉0 Qie ⊿ Y〉0, OP is at first quartile, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether set up, condition is set up and is determined that OP drags to shift to and be OB;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up and to be determined that OP drags to shift to and be OA;
Otherwise the dragging to shift to of OP is OH;
Described k is positive integer, and when system did not support floating point arithmetic, k was infinitely great;
As Guo ⊿ X〉0 Qie ⊿ Y<0, OP is in fourth quadrant, at this moment Rule of judgment k* ⊿ Y/ ⊿ X 〉-tanTable[0] whether to set up, condition is set up and is determined that OP drags to shift to and be OB;
Otherwise, Rule of judgment-tanTable[0]>=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X>=-tanTable[1] whether to set up, condition is set up and to be determined that OP drags to shift to and be OC;
Otherwise the dragging to shift to of OP is OD;
Described k is positive integer, and when system did not support floating point arithmetic, k was infinitely great;
As Guo ⊿ X<0 Qie ⊿ Y〉0, OP is at the second quadrant, at this moment Rule of judgment k* ⊿ Y/ ⊿ X 〉-tanTable[0] whether to set up, condition is set up and is determined that OP drags to shift to and be OF;
Otherwise, Rule of judgment-tanTable[0]>=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X>=-tanTable[1] whether to set up, condition is set up and to be determined that OP drags to shift to and be OG;
Otherwise the dragging to shift to of OP is OH;
Described k is positive integer, and when system did not support floating point arithmetic, k was infinitely great;
As Guo ⊿ X<0 Qie ⊿ Y<0, OP is at third quadrant, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether to set up, condition is set up and is determined that OP drags to shift to and be OF;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up and to be determined that OP drags to shift to and be OE;
Otherwise the dragging to shift to of OP is OD;
Described k is positive integer, and when system did not support floating point arithmetic, k was infinitely great.
In the embodiment of the present invention by n(n>=2) individual direction judges to drag and shifts to, wherein be divided into and be 2n angle, drag and shift to error in judgement in 360 °/2n angle, error is less, accuracy rate is higher, refresh sooner, simultaneously, n can infinitely great expand, n is larger, error is less, drags to shift to more accurately, and the method can also adopt cotangent, sine, cosine, secant, cosecant trigonometric function method to realize.
Embodiment two
Fig. 4 is that a kind of judgement of the embodiment of the present invention drags the system construction drawing of shifting to.
Described system comprises: tangent table initial module, coordinate processing module, quadrant judge module, shift to judge module;
Tangent table initial module, with the coordinate processing module with shift to judge module and be connected, be used for receiving and shifting to the request that judge module obtains tangent value, and send qualified tangent value to shifting to judge module according to judging the quantity that drags the direction of shifting to tangent table assignment;
Understand for convenient herein, take 8 directions as the example explanation, as shown in Figure 4, the described quantity that drags the direction of shifting to according to judgement is 8, tanTable={k*tan22.5 °, k*tan67.5 ° }, wherein tanTable is the tangent table, 22.5 ° being 360 ° is divided into the number of degrees that 16 grades are divided angle, 67.5 ° be one 16 grade divide angle and one 8 etc. divide angle and; Wherein k is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool;
The coordinate processing module is connected with the quadrant judge module with tangent table initial module, be used for to trigger to drag the request of shifting to, and determines to drag to shift to starting point and terminal point coordinate;
The quadrant judge module, with the coordinate processing module with shift to judge module and be connected, be used for the place quadrant of shifting to that drags that judgement coordinate processing module triggers, and request is shifted to judge module and is shifted to the place quadrant and drag the judgement of shifting to according to dragging;
Described quadrant judgement is to determine with respect to the value of the side-play amount of origin according to dragging the terminal point coordinate of shifting to;
Shift to judge module, be connected with tangent table initial module with the quadrant judge module, be used for receiving the result that drags the concrete quadrant in place of shifting to that the quadrant judge module is sent, k doubly amplifies terminal point coordinate with respect to the tangent value of the side-play amount of origin, contrast one by one with each tangent value of tangent table initial module and determine to drag the direction of shifting to, the process of determining to drag the direction of shifting to comprises:
As Guo ⊿ X〉0 Qie ⊿ Y〉0, the line of starting point and terminal point is at first quartile, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis positive dirction;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the first quartile diagonal;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis positive dirction.
Qi Zhong ⊿ X, ⊿ Y is that terminal point is with respect to the side-play amount of starting point on X-axis, Y-axis; TanTable[0], tanTable[1] represent each angle tangent value K doubly; ﹠amp; ﹠amp; Represent that former and later two conditions must all satisfy; K is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
The described direction of shifting to that drags is that to drag the origin coordinates of shifting to be initial point judges the angle that the decile that drags the direction quantity of shifting to forms take the horizontal X axle as a limit around initial point the wherein direction on a limit;
The explanation as an example of 8 directions example as shown in Figure 4, forms altogether 8 grades and divides angle to be: BOA, AOH, HOG, GOF, FOE, EOD, DOC, COB, and wherein 8 limit OA, OH, OG, OF, OE, OD, OC, OB drag the direction of shifting to;
It is that the result of described concrete quadrant refers to drag what shift to the place for which quadrant.
Described tangent table can adopt cotangent, sine, cosine, secant, cosecant trigonometric function method to realize the assignment of cotangent table, sine table, cosine table, secant table, cosecant table equally, and specific algorithm is similar, does not do narration one by one here.
It is as follows that described judgement drags the system work process of shifting to:
Tangent table initial module is according to judging that the quantity that drags the direction of shifting to determines the assignment of tangent table; The coordinate processing module triggers and drags the request of shifting to, and determines the coordinate of starting point and terminal point; Quadrant processing module judgement drags the quadrant at the direction place of shifting to, and transmit a request to and shift to judge module and drag the direction judgement of shifting to; Shift to judge module and receive the result of shifting to concrete quadrant that drags that the quadrant processing module determines, relatively determine one by one to drag with each tangent value of tangent table initial module the direction of shifting to;
In the embodiment of the present invention, the assignment of tangent table can customize assignment and also can call the external system assignment, simultaneously tangent table initial module can flexible expansion to cotangent, sine, cosine, secant, cosecant assignment and as Rule of judgment; The quantity of assignment drags according to judgement the direction quantity of shifting to be determined, assignment can enlarge by infinitely great multiple, the applicable system that does not support floating point arithmetic, and it is more that judgement drags the direction quantity of shifting to, and error is less, refreshes faster.

Claims (9)

1. one kind drags the method for shifting to judgement, it is characterized in that, said method comprising the steps of:
Self-defined tangent table assignment;
Triggering drags the request of shifting to, and determines starting point and terminal point;
Take starting point as initial point, determine horizontal X axle and vertical Y axle;
Begin to be divided into around the initial point starting point minute angles such as n take the horizontal X axle as a limit;
Minute angles such as described each n are halved again, formed minute angles such as n of second;
Determine that according to the relation of the tangent value of terminal point coordinate side-play amount and the numerical value in self-defined tangent table the dragging of line of starting point and terminal point shift to, specifically comprise:
As Guo ⊿ X〉0 Qie ⊿ Y〉0, the line of starting point and terminal point is at first quartile, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis positive dirction;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the first quartile diagonal;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis positive dirction;
Qi Zhong ⊿ X, ⊿ Y is that terminal point is with respect to the side-play amount of starting point on X-axis, Y-axis; TanTable[0], tanTable[1] represent each angle tangent value K doubly; ﹠amp; ﹠amp; Represent that former and later two conditions must all satisfy; K is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
2. as claimed in claim 1 dragging shifted to determination methods, it is characterized in that, described tangent table assignment is:
tanTable={k*tan22.5°,k*tan67.5°};
Wherein tanTable is the tangent table, and 22.5 ° are 360 ° and are divided into the number of degrees that 16 grades are divided angle, 67.5 ° be one 16 grade divide angle and one 8 etc. divide angle and; Wherein k is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
3. as claimed in claim 1 dragging shifted to determination methods, it is characterized in that:
Described " self-defined tangent table assignment " step is replaceable is " self-defined cotangent/sin/cos/secant/cosecant table assignment ";
Described " determining that according to the relation of the tangent value of terminal point coordinate side-play amount and the numerical value in self-defined tangent table the dragging of line of starting point and terminal point shift to " replaceable is " determining that according to the relation of the numerical value in the cotangent/sin/cos of terminal point coordinate side-play amount/secant/cosecant value and self-defined cotangent/sin/cos/secant/cosecant table the dragging of line of starting point and terminal point shift to ".
4. as claimed in claim 1 dragging shifted to determination methods, it is characterized in that, step " is determined that according to the relation of the tangent value of terminal point coordinate side-play amount and the numerical value in self-defined tangent table the dragging of line of starting point and terminal point shift to " and also comprised before step:
Whether the line that judges starting point and terminal point overlaps with 4 change in coordinate axis direction;
If so, determine the line direction of starting point and terminal point according to the side-play amount of terminal point horizontal ordinate and ordinate;
If not, the line place quadrant of judgement starting point and terminal point;
Enter step and " determine that according to the relation of the tangent value of terminal point coordinate side-play amount and the numerical value in self-defined tangent table the dragging of line of starting point and terminal point shift to ".
5. as claimed in claim 4 dragging shifted to determination methods, it is characterized in that, step " whether the line that judges starting point and terminal point overlaps with 4 change in coordinate axis direction " is specially:
As Guo ⊿ X=0 Qie ⊿ Y〉0, the line of starting point and terminal point drags the positive dirction of shifting to as Y-axis;
As Guo ⊿ X=0 Qie ⊿ Y<0, the line of starting point and terminal point drags the negative direction of shifting to as Y-axis;
As Guo ⊿ X〉0 Qie ⊿ Y=0: the line of starting point and terminal point drags the positive dirction of shifting to as X-axis;
As Guo ⊿ X<0 Qie ⊿ Y=0, the line of starting point and terminal point drags the negative direction of shifting to as X-axis;
Qi Zhong ⊿ X is that terminal point is the side-play amount of terminal point on Y-axis at the side-play amount , ⊿ Y on X-axis.
6. as claimed in claim 1 dragging shifted to determination methods, it is characterized in that, described, and " determining that according to the relation of the tangent value of terminal point coordinate side-play amount and the numerical value in self-defined tangent table the dragging of line of starting point and terminal point shift to " specifically also comprises step:
As Guo ⊿ X〉0 Qie ⊿ Y<0, the line of starting point and terminal point is in fourth quadrant, at this moment Rule of judgment k* ⊿ Y/ ⊿ X 〉-tanTable[0] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis positive dirction;
Otherwise, Rule of judgment-tanTable[0]>=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X>=-tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the fourth quadrant diagonal line;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis negative direction;
As Guo ⊿ X<0 Qie ⊿ Y〉0, the line of starting point and terminal point is at the second quadrant, at this moment Rule of judgment k* ⊿ Y/ ⊿ X 〉-tanTable[0] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis negative direction;
Otherwise, Rule of judgment-tanTable[0]>=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X>=-tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged that to shift to be the second quadrant diagonal;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis positive dirction;
As Guo ⊿ X<0 Qie ⊿ Y<0, the line of starting point and terminal point is at third quadrant, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis negative direction;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the third quadrant diagonal;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis negative direction;
Qi Zhong ⊿ X, ⊿ Y is that terminal point is with respect to the side-play amount of starting point on X-axis, Y-axis; TanTable[0], tanTable[1] represent each angle tangent value K doubly; ﹠amp; ﹠amp; Represent that former and later two conditions must all satisfy; K is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
7. one kind drags the system that shifts to judgement, it is characterized in that, described system comprises:
Tangent table initial module, coordinate processing module, quadrant judge module, shift to judge module;
Tangent table initial module, with the coordinate processing module with shift to judge module and be connected, be used for according to the quantity that will judge the direction number of shifting to tangent table assignment, the request that judge module obtains tangent value is shifted in reception, and sends qualified tangent value to shifting to judge module;
The coordinate processing module is connected with the quadrant judge module with tangent table initial module, be used for to trigger to drag the request of shifting to, and determines to drag to shift to starting point and terminal point coordinate;
The quadrant judge module, with the coordinate processing module with shift to judge module and be connected, be used for the place quadrant of shifting to that drags that judgement coordinate processing module triggers, and request is shifted to judge module and is shifted to the place quadrant and drag the judgement of shifting to according to dragging;
Shift to judge module, be connected with tangent table initial module with the quadrant judge module, be used for receiving the result that drags the concrete quadrant in place of shifting to that the quadrant judge module is sent, k doubly amplifies terminal point coordinate with respect to the tangent value of the side-play amount of origin, contrast one by one with each tangent value of tangent table initial module and determine to drag the direction of shifting to, the process of determining to drag the direction of shifting to comprises:
As Guo ⊿ X〉0 Qie ⊿ Y〉0, the line of starting point and terminal point is at first quartile, at this moment Rule of judgment k* ⊿ Y/ ⊿ X<tanTable[0] whether set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the X-axis positive dirction;
Otherwise, Rule of judgment tanTable[0]<=k* ⊿ Y/ ⊿ X﹠amp; ﹠amp; K* ⊿ Y/ ⊿ X<=tanTable[1] whether to set up, condition is set up the line of determining starting point and terminal point and is dragged to shift to and be the first quartile diagonal;
Otherwise the dragging to shift to of the line of starting point and terminal point is the Y-axis positive dirction;
Qi Zhong ⊿ X, ⊿ Y is that terminal point is with respect to the side-play amount of starting point on X-axis, Y-axis; TanTable[0], tanTable[1] represent each angle tangent value K doubly; ﹠amp; ﹠amp; Represent that former and later two conditions must all satisfy; K is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
8. the judgement system of shifting to that drags as claimed in claim 7 is characterized in that:
TanTable={k*tan22.5 °, described tangent table, k*tan67.5 ° }, 22.5 ° are 360 ° and are divided into the number of degrees that 16 grades are divided angle, 67.5 ° be one 16 grade divide angle and one 8 etc. divide angle and; Wherein k is positive integer, and when system did not support floating point arithmetic, k was infinitely great, and the assignment of each tangent value is to generate through calling external tool.
9. the judgement system of shifting to that drags as claimed in claim 7 is characterized in that:
Described " tangent table initial module " is replaceable is " cotangent/sin/cos/secant/cosecant table initial module "; Described " tangent value " replaces with " cotangent/sin/cos/secant/cosecant value ".
CN2010102854836A 2010-09-17 2010-09-17 Method and system for judging dragged moving direction Expired - Fee Related CN102012782B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN2010102854836A CN102012782B (en) 2010-09-17 2010-09-17 Method and system for judging dragged moving direction
PCT/CN2011/076161 WO2012034432A1 (en) 2010-09-17 2011-06-22 Method and system for judging drag moving direction
HK11110077.2A HK1155829A1 (en) 2010-09-17 2011-09-23 Method and system for judging dragged moving direction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102854836A CN102012782B (en) 2010-09-17 2010-09-17 Method and system for judging dragged moving direction

Publications (2)

Publication Number Publication Date
CN102012782A CN102012782A (en) 2011-04-13
CN102012782B true CN102012782B (en) 2013-06-05

Family

ID=43842960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102854836A Expired - Fee Related CN102012782B (en) 2010-09-17 2010-09-17 Method and system for judging dragged moving direction

Country Status (3)

Country Link
CN (1) CN102012782B (en)
HK (1) HK1155829A1 (en)
WO (1) WO2012034432A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012782B (en) * 2010-09-17 2013-06-05 深圳市融创天下科技股份有限公司 Method and system for judging dragged moving direction
CN105700784A (en) * 2014-11-28 2016-06-22 神讯电脑(昆山)有限公司 Touch input method and electronic apparatus
CN113269376B (en) * 2021-07-19 2021-11-12 中国水利水电科学研究院 River flood peak flow range calculation method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420506A (en) * 2007-10-26 2009-04-29 村田机械株式会社 Image processing apparatus, image scanning apparatus, image processing method, and image processing program
CN101751008A (en) * 2008-12-18 2010-06-23 陈学恭 Interpolation method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7814436B2 (en) * 2003-07-28 2010-10-12 Autodesk, Inc. 3D scene orientation indicator system with scene orientation change capability
KR100791287B1 (en) * 2005-10-26 2008-01-04 삼성전자주식회사 Apparatus and method for controlling three-dimensional motion of graphic object
CN101408824A (en) * 2008-11-18 2009-04-15 广东威创视讯科技股份有限公司 Method for recognizing mouse gesticulation
CN102012782B (en) * 2010-09-17 2013-06-05 深圳市融创天下科技股份有限公司 Method and system for judging dragged moving direction

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420506A (en) * 2007-10-26 2009-04-29 村田机械株式会社 Image processing apparatus, image scanning apparatus, image processing method, and image processing program
CN101751008A (en) * 2008-12-18 2010-06-23 陈学恭 Interpolation method

Also Published As

Publication number Publication date
HK1155829A1 (en) 2012-05-25
CN102012782A (en) 2011-04-13
WO2012034432A1 (en) 2012-03-22

Similar Documents

Publication Publication Date Title
US8638190B1 (en) Gesture detection using an array of short-range communication devices
US20150363076A1 (en) Information processing system and display control method
CN103733229A (en) Information processing device, information processing method, and program
CN107885871A (en) Synchronous superposition method, system, interactive system based on cloud computing
CN105164500A (en) System and method for indicating user location and facing direction on digital map
JP6217437B2 (en) Terminal apparatus, information processing apparatus, display control method, and display control program
EP2930959B1 (en) Locating method, drive test terminal and hand-held terminal
EP3096489B1 (en) Remote control method and apparatus
CN102012782B (en) Method and system for judging dragged moving direction
JP6543924B2 (en) INFORMATION PROCESSING METHOD, INFORMATION PROCESSING PROGRAM, AND INFORMATION PROCESSING APPARATUS
CN103984720A (en) Tile map establishment method and device based on OpenGL (open graphics library)
CN103076945B (en) Touch screen type interface of electronic equipment edit methods and device
CN107066648A (en) Pipe space collision checking method and device
CN105592546A (en) Indoor positioning system, positioning server and indoor positioning method
CN104750410A (en) Electronic Devices, And File Sharing Methods Thereof And Comoputer Program Product
CN105203994B (en) A kind of electronic tag localization method, device, server and system
US11749230B2 (en) Rotational image viewer
CN104142786A (en) Prompt box display method and terminal
CN104884973B (en) The located sites in building enclosure
CN103095341A (en) Data transmission control method and electronic equipment
CN104050869B (en) GIS map covering is layouted response method and system
CN109899053B (en) Method and device for determining drilling well site and computer readable storage medium
CN106406572A (en) Cursor control method and apparatus
CN104978081A (en) Method for determining touch position of touch control screen and touch control device
CN205175416U (en) Mobile robot positioning system based on laser and inertia measuring unit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1155829

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1155829

Country of ref document: HK

C56 Change in the name or address of the patentee

Owner name: SHENZHEN RONGCHANG TIANXIA TECHNOLOGY CO., LTD.

Free format text: FORMER NAME: SHENZHEN TEMOBI SCIENCE + TECHNOLOGY CO., LTD.

CP01 Change in the name or title of a patent holder

Address after: 19, building 18, Changhong technology building, 518057 South twelve Road, South tech Zone, Nanshan District hi tech Zone, Guangdong, Shenzhen

Patentee after: SHENZHEN TEMOBI TECHNOLOGY CO., LTD.

Address before: 19, building 18, Changhong technology building, 518057 South twelve Road, South tech Zone, Nanshan District hi tech Zone, Guangdong, Shenzhen

Patentee before: Shenzhen Temobi Science & Tech Development Co.,Ltd.

ASS Succession or assignment of patent right

Owner name: RONGCHUANG TIANXIA (SHANGHAI) TECHNOLOGY DEVELOPME

Free format text: FORMER OWNER: SHENZHEN RONGCHANG TIANXIA TECHNOLOGY CO., LTD.

Effective date: 20150610

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20150610

Address after: 200433 Shanghai City, Yangpu District Wei Road No. 6 room 502-8

Patentee after: World (Shanghai) Technology Development Co., Ltd.

Address before: 19, building 18, Changhong technology building, 518057 South twelve Road, South tech Zone, Nanshan District hi tech Zone, Guangdong, Shenzhen

Patentee before: SHENZHEN TEMOBI TECHNOLOGY CO., LTD.

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130605

Termination date: 20170917

CF01 Termination of patent right due to non-payment of annual fee