I have this code block
double[] tabHeight = { 16, 10, 15, 20 };
double[] tabMidSectionWA = { 6, 2, 5, 6 };
double[] tabCurveWA = {
(tabHeight[0] - tabMidSectionWA[0]) / 2 ,
(tabHeight[1] - tabMidSectionWA[1]) / 2,
(tabHeight[2] - tabMidSectionWA[2]) / 2 ,
(tabHeight[3] - tabMidSectionWA[3]) / 2
};
Is there an easier way to add these values using the formula of (tabheight - tabMid) / 2
using a for loop or foreach?