4.47 heron - Area of Triangle

Format: sim(type,$num_1,num_2,\cdots ,n_ k,num_{k+1},num_{k+2},\cdots ,num_{2k},num_{2k+1},num_{2k+2},\cdots ,num_{3k}$)

Computes the area of a triangle given the 3 points of coordinates at k-dimensional space $(num_1,num_2,\cdots ,n_ k),(num_{k+1}, num_{k+2},\cdots ,num_{2k)} ,(num_{2k+1},num_{2k+2},\cdots ,num_{3k})$ at k-dimensional space.

Example

Example 1: Basic Example

$ more dat1.csv
id,x1,y1,x2,y2,x3,y3
1,0,0,1,0,0,1
2,0,0,0,2,2,0
4,,,,,,
3,0,0,1,1,2,2
$ mcal c='heron(${x1},${y1},${x2},${y2},${x3},${y3})' a=rsl i=dat1.csv o=rsl1.csv
#END# kgcal a=rsl c=heron(${x1},${y1},${x2},${y2},${x3},${y3}) i=dat1.csv o=rsl1.csv
$ more rsl1.csv
id,x1,y1,x2,y2,x3,y3,rsl
1,0,0,1,0,0,1,0.5
2,0,0,0,2,2,0,2
4,,,,,,,
3,0,0,1,1,2,2,0