Static void triangle(int a, int b, int c)Ĭonsole.WriteLine("Triangle is " + angle(a, b, c) + " and " + typeTriangle(a, b, c)) Ĭonsole.WriteLine("Enter the sides of triangle: ") Ĭonsole.WriteLine("Triangle cannot be formed") Īfter the execution of the above code, and entering the input, the output will be. If(a>b & a>c) // when largest side is 'a'Įlse if(x a & b>c) // when largest side is 'b' Static string angle(int a, int b, int c) //function to find angle Static string typeTriangle(int a, int b, int c) //function to find type of triangle Program: Write a program to find the type of triangle from the given coordinates in C#. If(a = 0 || b = 0 || c = 0) // to check whether length of any side is 0 or not If(a>b & a>c) // here, the largest side is 'a'Įlse if(x a & b>c) //here, the largest side is 'b' String angle(int a, int b, int c) // function to calculate the angle of triangle String typeTriangle(int a, int b, int c) // function to calculate the type of triangle Program: Write a program to find the type of triangle from the given coordinates in C++. So, basically, we will use the sides of a triangle to find its type and angle. If the sum of the squares of the two sides of a triangle is greater than the square of the largest side, the triangle will be an acute angle triangle.If the sum of squares of the smaller sides is less than the square of the largest side, the triangle will be an obtuse angle triangle.If the sum of square of the two sides is equal to the square of the third side, the triangle will be a right-angle triangle.And after comparing the sides, there will be a comparison between angles.This classification is simple because if all sides are equivalent triangle will be equilateral, if two sides are equal triangle will be isosceles, if no sides are equal triangle will be scalene. The programs will be made by comparing the given length of sides of the triangle.The approach that we are using in programs is given as follows. Programs to find the type of triangle from the given coordinates Now, let's see the programs to find the type of triangle from the given coordinates. It has no equal sides and no equal angles. Scalene triangleĪ scalene triangle has no line of symmetry. It has two equal sides and two equal angles. Isosceles triangleĪn isosceles triangle has one line of symmetry. It has three equal-length sides and three equal angles. Equilateral triangleĮach angle of an equilateral triangle is of 60 degrees. Let's see a brief description of types of triangles. Triangles are of three types that are listed as follows. The sum of three interior angles of a triangle is 180 degrees. TriangleĪ triangle is a polygon that has three vertices and three edges. In this article, we will see the programs to find the type of triangle from the given coordinates in different programming languages.īefore jumping directly to the programs, let's first see a brief description of the triangle. The isosceles triangle (I can NEVER remember how to spell isosceles) has two sides that are the same length (congruent) and two angles that are the same size (congruent).Next → ← prev Program to find the type of triangle from the given coordinates Since the sum of the angles of a triangle is always 180 degrees, we can figure out the measure of the angles of an equilateral triangle: In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). and the side opposite of the right angle is called the hypotenuse. The two sides of the triangle that are by the right angle are called the legs. Since the sum of the angles of a triangle is always 180 degrees. The right triangle has one 90 degree angle and two acute (< 90 degree) angles. Just scroll down or click on what you want and I'll scroll down for you! Definitions and formulas for triangles including right triangles, equilateral triangles, isosceles triangles, scalene triangles, obtuse triangles and acute triangles
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |