CS262, Fall 2011, Section 005 Program assignment 1 (PA1) Instructor: Jyh-Ming Lien, jmlien@cs.gmu.edu Due date: Sep 16 2011 (by midnight, 11:59pm) Description: Give two triangles, determine if these two triangles are similar. Two triangles are similar if one can be uniformly scaled to the other one. Input: The input will contain even number of triangles. Each triangle is represented by 3 vertices in counterclockwise order. Each vertex has two integer coordinates. So, every 12 integers define two triangles. Your program should read these triangles from the standard input until you detect the end of file (EOF). Output: Print to the standard output. If two triangles are similar, print "similar". Otherwise print "not similar". All in lower case. Each output should be in its own line. Example Input: -2 0 2 0 0 2 9 0 0 9 -9 0 1 1 2 2 5 0 6 0 1 1 2 2 (EOF) Example Output: similar not similar Note: If you use math.h, use -lm switch to tell gcc to link in the math library: EX: gcc pa1-005.c -lm To turn in: Submit a copy of your (well commented) source code and a sample terminal session showing several runs of your program. Show your example input clearly in your sample terminal session. You can use the example input above and create two more make-up examples. Your source code should have name "pa1-005.c" and your terminal session should have name "pa1-005.txt". Make sure that you code is well documented. Make sure that your documented code includes your name and the assignment number. Send your documents to cs262.2011fall.lien@gmail.com with subject line PA1-005-(Your G#)