Description: Enter four points to determine whether a parallelogram can be formed at four points.
In the program, an abstract data type Vector2D represents a vector. It has two values of (x, y). It has minus the other vector (minus (Vector2D)), and determines whether it is the zero vector (iszero ()), and the difference between the value of the other vector and the difference of x product (Vector2D). Because the two vectors are parallel, the product difference is x1 times y2 minus x2 times y1 is equal to 0. Point A, B, C, D, four, the conditions of the parallelogram are AB// CD, BC//DA and none of the vectors are zero vectors.
Let's start by declaring four vectors. The method for obtaining the value of vector I is obtained by getPoint(int I). The vector output is then viewed according to the toString () function after Vector2D overloading. Finally, we can determine whether these four points can be composed of parallel four edges.
- [ts] - Chat program with client and server-side
- [s_fair] - Regular premiums calculated one. The def
File list (Check if you may need any files):