Initial Basics – Geometry – Problem #9
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Problem Statement
Write a C Program that reads in three points on a 2 dimensional plane (integers). All three will not be in a single straight line. These are corner points of an isosceles triangle T1. You will first test whether the triangle T1 is indeed an isosceles triangle or not. If it is isosceles, you will find the lengths of base, height and also the area of the triangle T1 and print them. Next, you will find the length of the isosceles side of a Triangle T2, which has double the area and three times the base length as T1 and print it. Save the file as A01_<Roll Number>.c (example A01_21AG10002.c). Build, Run for and test it for the given data. Then upload the .c file for the Assignment. In particular, you will do the following: 1. Read x and y integer coordinates of three points of T1 and print them. 2. Find out the lengths of the three sides of T1 and print them. 3. Test whether they form an isosceles triangle. If no, print that T1 is not an isosceles triangle and end. 4. If it is an isosceles triangle, then print the lengths of base and height of T1 and also print the area of T1. If T1 is an isosceles triangle, then print the length of the isosceles side of another isosceles triangle T2 whose base is three times that of T1 and area is twice that of T1. Test Data: 5. Test 1: <0,0>, <10,0>, <5,5>, Test 2: <4,12>, <8,16>, <3,3> Test 3: <10,10>, <-3,3>, <3,-3>