📜  如何计算三角形的面积 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:52.443000             🧑  作者: Mango

代码示例1
first you should know these details about the triangle(for the area) - 
hight (center)
and the base lenght

now, mutiply the height by the base and divide it by '2'

//code
var base = 5
var height = 9
var ans = (base * height) / 2
console.log(ans)