Write a fortran 95 program to find angles of the triangle using Vector Algebra i
ID: 3640027 • Letter: W
Question
Write a fortran 95 program to find angles of the triangle using Vector Algebra if the three vertices [0,0,0], [1,2,3], [4,-1,3], of the triangle are given.Explanation / Answer
#include #include int IsPointInBoundingBox(float x1, float y1, float x2, float y2, float px, float py) { float left, top, right, bottom; // Bounding Box For Line Segment // For Bounding Box if(x1 90 || *angleC > 90) return 2; // obtuse Triangle else return 3; // Rightangle Triangle } void main() { float m1, c1, m2, c2; float ax, ay, bx, by, cx, cy; float angleA, angleB, angleC; int type = 0; float total = 0; printf("Program to find the type of a triangle: "); printf("Enter Triangle Point A - X: "); scanf("%f", &ax); printf("Enter Triangle Point A - Y: "); scanf("%f", &ay); printf("Enter Triangle Point B - X: "); scanf("%f", &bx); printf("Enter Triangle Point B - Y: "); scanf("%f", &by); printf("Enter Triangle Point C - X: "); scanf("%f", &cx); printf("Enter Triangle Point C - Y: "); scanf("%f", &cy); type = Calculate_Triangle_Type(ax, ay, bx, by, cx, cy, &angleA, &angleB, &angleC); total = angleA + angleB + angleC; printf("Angle between the lines is %.4f, %.4f, %.4f ", angleA, angleB, angleC); if(type == 1) printf(" Acute Triangle"); else if(type == 2) printf(" Obtuse Triangle"); else if(type == 3) printf(" Right Triangle"); printf(" "); } output: Program to find the type of a triangle: Enter Triangle Point A - X: 1 Enter Triangle Point A - Y: 1 Enter Triangle Point B - X: 20 Enter Triangle Point B - Y: 10 Enter Triangle Point C - X: 10 Enter Triangle Point C - Y: 20 Angle between the lines is 39.3063, 70.3438, 70.3438 Acute Triangle Press any key to continue . . .Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.