// the centroid is the average of these points
centroid = div(p1+p2+p3,3);

Orientation:// applied to the orientation parameter, this expression looks down the normal of the a plane defined by three points from its centroid
p1 = thisComp.layer("Null 1").transform.position;
p2 = thisComp.layer("Null 2").transform.position;
p3 = thisComp.layer("Null 3").transform.position;

// the centroid is the average of these points
centroid = div(p1+p2+p3,3);