Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, January 15, 2013

Brahmagupta's Formula For Quadrilateral Area



Question: What is the area of a quadrilateral with sides equal to 18, 22, 39, and 41 respectively?

Answer: 798

console.log("********************************");
function Brahmagupta(a,b,c,d){
var perimeter=a+b+c+d;
var s = perimeter/2;
return Math.sqrt((s-a)*(s-b)*(s-c)*(s-d));
}
console.log(Brahmagupta(18,22,39,41));

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts