The example in this article tells you how to draw a straight line in PHP. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
1. Create Canvas
$im = Imagecreatetruecolor (300,200);//Create a new true color image, the default background is black, and return the image identifier. Another function, imagecreate, is deprecated.
2, to draw the desired image
$red = Imagecolorallocate ($im, 25
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
problem 2216 the longest straightaccept:82 submit:203Time limit:1000 mSec Memory limit:32768 KB problem 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
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
/*************************************** *********************************//*11. N points on the plane, each of which determines a straight line*//************************************* * **********************************/Class point {public: point (double valx = 0.0, double Valy = 0.0): X (valx), y (Valy) {} Double X; Double Y ;}; // calculate the distance from srcpt to a straight line. A positive value is
Create a project createline. The procedure is the same as that of 1.4helloworld. Register a command and define its own name. I use it as createline just like Miss Zhang Fan.
Mode has two options. Although I do not know the differences between the two options, follow the instructions of instructor Zhang Fan. If anyone knows, please tell me, thank you first. After the command is created, a defined function static void xbcreateline (void) is also obtained. Add the code to draw a
Mirror and light
Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 821 accepted submission (s): 387
Problem descriptionthe light travels in a straight line and always goes in the minimal path between two points, are the basic laws of optics.
Now, our problem is that, if a branch of light goes into a large and infinite mirror, of course, it will reflect, and leave away the mirror in another directio
From: http://vastskysun.blogchina.com/2557937.html
Straight line Hough Transformation converts detection problems in image space to parameter space by using the point-to-line parity between image space and parameter space. By performing simple accumulate statistics in the parameter space, and then finding the method for detecting the straight line in the parameter space. For example, the nine line segments
(3600,'angle:'+ Angle1 +'°,'+ Angle2 +'°,'+ Angle3 +'°','Image', -, -,'Red','true')Results:Step Analysis:① image triangle is mainly composed of 3 straight lines;② threshold, skeleton extract skeleton, the skeleton (region) to Xld, the xld break split, filter XLD get 3 main xld, the 3 xld to be synthesized 3 straight lines .Effect Analysis:Although the procedure is simple, the robustness is not good. The ma
Chapter 3 plane and Spatial Straight Lines
Teaching Purpose of this Chapter: Through the study in this chapter, students can master various forms of plane and linear equations in the spatial coordinate system, and be familiar with the analytical conditions for the positional relationship between the plane and spatial straight lines, calculates the distance and angle between the plane and the spatial
Js cool ball running along the straight line navigation bar special effects source code sharing
I have been working on an enterprise website recently. Today, I want to share a front-end demo with JavaScript.
The main effect, first. As follows:
Ha ~ I have stolen the logo of the Code. Don't blame me.
Because it is not deployed on the internet, I will describe the main animation effects!
First effect: There is a ball in it that will run along the red
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.