One. To find two lines of intersection
Copy Code code as follows:
Class Point {
Double X;
Double y;
Public Point () {
this.x = 0;
This.y = 0;
}
}
Class Line {
Point A;
Point B;
Public Line () {
THIS.A = new Point ();
this.b = new Point ();
}
Find the intersection of two straight lines, the same slope res=u.a
Point intersection (line U,line v) {
Point res = U.A;
Double T = ((u.a.x-v.a.x) * (V.B.Y-V.A.Y)-(U.A.Y-V.A.Y) *
Copy Code code as follows:
Title: There are n lines that can divide a plane up to a number of parts Number of lines: Inner intersection: Split number:
Say the law:
① the most divided parts: line number + internal intersection points +1
The number of intersections within the ② = (line number-1) of the internal intersection point + (line number-1), the newly added line can be with the other than the line intersection points
③ uses recursion to find the inner intersection number and
The judgment point is on one side of the straight line.
Method 1:
Http://zhidao.baidu.com/question/47341112.html
If we know P (0, 0), Q (3, 2) two points, we try to determine whether p and q are on the same side of the line 2x + 3y = 4.
Solution: Straight Line 2x + 3y = 4That is, the line is 2x + 3y-4 = 0Replace p and q with 2x + 3y-4 to get2*0 + 3*0-4 =-4 2*3 + 3*2-4 = 8So on both sides!
Method 2
Copy codeThe Code is as follows:Question: A maximum of n straight lines can divide a plane into several parts Number of lines: Inner point: Number of partitions:
Rule:
① Most divided parts: number of lines + inner points + 1
② Inner point = (number of lines-1) Inner point + (number of lines-1), the newly added line can have an intersection with other lines
③ Use recursion to find the number of inner points, and then substitute it into ① for Calculati
Label: A circle contains a finite number of vertices. A straight line does not pass through any point and equals all vertices.Consider this problem from outside the circle.Randomly find a straight line l that is separated from the circle, and then draw a straight line between each two points to mark the intersection with L (if parallel, ignore ), then start to ro
the decimal point. the line shoshould contain no blanks.
Sample Input
15 4 6 7 824 2 7 8 97 3 4.5 6 7-1
Sample output
10.0010.06
SourceMid-Central USA 1996
At the beginning, it was really a second force,
1. The function used to determine the intersection is wrong. I have determined whether it is a straight line between the source point and the end point... Second force ah ,,,
2. After the change, we will return wa, because one is missing in the judg
Sometimes it is necessary to obtain the intersection between a straight line and various graphics, including polygon and various QT graphic boxes.
For example, to keep the connection line on the side of a polygon and point to the center of the polygon, we need to obtain the intersection of the AB and polygon of the line.
1. intersection of a polygon (qgraphicspolympus gonitem) and a straight line (qlin
This tutorial is intended to introduce three methods of using Photoshop to draw a straight line. it is a relatively basic tutorial and suitable for beginners to learn. we recommend that you use the script home, let's take a look. this tutorial introduces three methods to draw a straight line using Photoshop to a friend at the foot of the house. The tutorial is relatively basic and suitable for beginners to
Find the intersection of two straight lines in the plane. When the two straight lines are uneven, there must be only one intersection.
/* Returns the intersection of two straight lines */PointLinesintersection(Line m, line N, int * flag) {double D = n. A * m. b-M. A * n. b; If (D = 0) {* flag = 0; return;} Point I; I. X = (N. B * m. c-M. B * n. c)/d; I. y = (M.
Question link: http://poj.org/problem? Id = 3304
T case, each case contains n lines to determine whether a straight line exists, so that all lines can have common points in this line. If yes is output, otherwise, no is output.
The meaning of the question can be changed to: Can two vertices in 2 * n endpoints of n straight lines form a straight line to meet this c
Canvas entry (1): draws basic images such as rectangles, circles, straight lines, and curves. canvas rectangles
Source: http://www.ido321.com/968.html
I. Basic Canvas knowledge
Canvas is a new element in HTML 5 and is used to draw images. The canvas element is equivalent to a "canvas", a colorless transparent area. You need to use JavaScript to write a painting script in it.
It is easy to place the canvas element on the page. You can use the
Ii. Can
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1466
Number of intersection points of n straight lines = number of intersection points of c straight lines and (n-C) parallel lines + intersection of C straight lines = (n-C) * The intersection points between the C + C straight lines.
1 #include View code
/* DP divides I straight lines into the two parts: R lines that are not parallel to each other + (I-r) parallel straight lines (where each of the two and the intersection are not parallel to each other have R intersections) I straight line intersection points = r straight line intersection points + (I-r) * r; (1
X1y1x2y2x3y3x4y4. Thus each of these input lines represents, lines on the Plane:the line through (x1,y1) and (X2,y2) and the line Throug H (x3,y3) and (X4,y4). The point (x1,y1) is always distinct from (x2,y2). Likewise with (X3,y3) and (X4,y4).
OutputThere should be n+2 lines of output. The first line of output should read intersecting LINES output. There'll then being one line of output for each pair of planar lines represented by a line of input, describing how the Lin Es intersect:none, l
problem 2216 the longest straightAccept:7 submit:14 time limit:1000 mSec Memory limit:32768 KBproblem DescriptionZB is playing a card game where the goal are to make straights. Each card of the deck has a number between 1 and m (including 1 and M). A straight is a sequence of cards with consecutive values. Values do not wrap around, so 1 does not come after M. In addition to regular cards, the deck also contains jokers. Each joker can is used as any v
How can I restore a straight line that has already been rotated to its original horizontal state after being rotated? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061005165649268.html
How can I restore a straight line that is originally horizontal but has been rotated (the rotation angle is unknown) to its original horizontal state after being rotated?
You can use a
The so-called entity generation refers to the transformation of the parameter representation of the finished entity (as specified by the user of the graphics package) to the bitmap representation (the representation required by the raster Display system refresh). Usually also referred to as a scan transformation entity.Scan transformation of a line: determines the set of pixels that are best approximated to the line, and writes the pixels in the order of scan lines.Three commonly used algorithms
Find the vertical point B (x1, Y1) from point A (x0, y0) to the straight line AX + by + c = 0, which meets two conditions:
(1) ax1 + by1 + c = 0, point B on the straight line
(2) (y1-y0)/(x1-x0) * A/B = 1, two lines vertical, slope K1 * k2 =-1.
Note: (1) a1a2 + b1b2 = 0, (2) K1 * k2 =-1.
/* Calculate the vertical point from the point to the straight line */
Find the right of a (3, 1) on the linear x + Y-1 = 0
Best Answer
If the coordinate of the symmetric point is B (X, Y), the midpoint coordinate of AB is (3 + x)/2, (1 + Y)/2), and it is in a straight line.
(3 + x)/2 + (1 + Y)/2-1 = 0
(Y-1)/(X-3) = 1... (the slope of AB is 1)
Solution: x = 0, y =-2
Flash applications:
This is a problem on the Internet. It seems that it is not difficult at all.
Suppose we have a vertex A (x1, Y1), a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.