Rで書くとこんな感じ

area3 <- function(A,B,C){
a=sqrt(sum((B-C)^2))
b=sqrt(sum((C-A)^2))
c=sqrt(sum((A-B)^2))
s=(a+b+c)/2
return(sqrt(s*(s-a)*(s-b)*(s-c)))
}