Program to find the type of triangle from the given coordinatesIn this article, we will see the programs to find the type of triangle from the given coordinates in different programming languages. Before jumping directly to the programs, let's first see a brief description of the triangle. TriangleA triangle is a polygon that has three vertices and three edges. The sum of three interior angles of a triangle is 180 degrees. Triangles are of three types that are listed as follows -
Let's see a brief description of types of triangles. Equilateral triangleEach angle of an equilateral triangle is of 60 degrees. It has three equal-length sides and three equal angles. It has three lines of symmetry. Isosceles triangleAn isosceles triangle has one line of symmetry. It has two equal sides and two equal angles. Scalene triangleA scalene triangle has no line of symmetry. It has no equal sides and no equal angles. Now, let's see the programs to find the type of triangle from the given coordinates. Programs to find the type of triangle from the given coordinatesThe approach that we are using in programs is given as follows -
So, basically, we will use the sides of a triangle to find its type and angle. Program: Write a program to find the type of triangle from the given coordinates in C++. Output: Program: Write a program to find the type of triangle from the given coordinates in C#. Output: After the execution of the above code, and entering the input, the output will be - Program: Write a program to find the type of triangle from the given coordinates in Java. Output Program: Write a program to find the type of triangle from the given coordinates in JavaScript. Output After the execution of above code, the output will be - Similarly, we have to enter values for two more sides of triangle, after entering the values, the output will be - So, that's all about the article. Here, we have discussed the programs to find the type of a triangle from the given coordinates in C++, C#, Java, and JavaScript. Hope you find the article helpful and informative. Next TopicPrograms List |