{"id":12570,"date":"2021-09-30T11:30:51","date_gmt":"2021-09-30T06:00:51","guid":{"rendered":"https:\/\/python-programs.com\/?p=12570"},"modified":"2021-11-22T18:35:28","modified_gmt":"2021-11-22T13:05:28","slug":"python-program-to-calculate-area-of-any-triangle-using-its-coordinates","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-calculate-area-of-any-triangle-using-its-coordinates\/","title":{"rendered":"Python Program to Calculate Area of any Triangle using its Coordinates"},"content":{"rendered":"

Enhancing programming skills is very important no matter what language you have chosen. So, practice frequently with these simple java programs<\/a> examples and excel in coding the complex logic.<\/p>\n

GIven three coordinates of a triangle the task is to find the area of the given Triangle in Python.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

x coordinate of the first point = 6\r\ny coordinate of the first point = 2\r\nx coordinate of the second point = 9\r\ny coordinate of the first point = 11\r\nx coordinate of the third point = 5\r\ny coordinate of the first point = 17<\/pre>\n

Output:<\/strong><\/p>\n

The Area of the triangle with the given coordinates \u00a0(6,2) (9,11) (5,17) = 27.0<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

x coordinate of the first point = 3\r\ny coordinate of the first point = 7\r\nx coordinate of the second point = 2\r\ny coordinate of the first point = 11\r\nx coordinate of the third point = 9\r\ny coordinate of the first point = 7<\/pre>\n

Output:<\/strong><\/p>\n

The Area of the triangle with the given cordinates (3,7) (2,11) (9,7) = 12.0<\/pre>\n

Program to Calculate Area of any Triangle using its Coordinates in<\/h2>\n

Python<\/h2>\n

Below are the ways to calculate to find the area of the given Triangle in Python.<\/p>\n