private void CalculateLengthsAppro() { for (int i = 0; i < net.lengthNum; i++) { int start = net.netLengths[i].start; int end = net.netLengths[i].end; double length = NetPoint.Distance (net.netPoints[start], net.netPoints[end]); net.netLengths[i].value = length; observeAppro.value[i, 0] = length; } }
public void Equation_A() { double theta, dis, c_mp, d_mp, c_mc, d_mc; for (int i = 0; i < net.angleNum; i++) { int parent = net.netAngles[i].parent; int me = net.netAngles[i].me; int child = net.netAngles[i].child; //mp theta = NetPoint.Azimuth(net.netPoints[me], net.netPoints[parent]); dis = NetPoint.Distance(net.netPoints[me], net.netPoints[parent]); c_mp = -Math.Sin(theta) / dis; d_mp = Math.Cos(theta) / dis; theta = NetPoint.Azimuth(net.netPoints[me], net.netPoints[child]); dis = NetPoint.Distance(net.netPoints[me], net.netPoints[child]); c_mc = -Math.Sin(theta) / dis; d_mc = Math.Cos(theta) / dis; int row = i + net.lengthNum; if (parent != net.endKnownPoint && parent != net.startKnownPoint) { B.value[row, xDict[parent]] = -c_mp; B.value[row, yDict[parent]] = -d_mp; } if (me != net.endKnownPoint && me != net.startKnownPoint) { B.value[row, xDict[me]] = c_mp - c_mc; B.value[row, yDict[me]] = d_mp - d_mc; } if (child != net.endKnownPoint && child != net.startKnownPoint) { B.value[row, xDict[child]] = c_mc; B.value[row, yDict[child]] = d_mc; } } }