UcteConverterHelper { public static double calculateAsymmAngleDu(TwoWindingsTransformer twoWindingsTransformer) { PhaseTapChanger phaseTapChanger = twoWindingsTransformer.getPhaseTapChanger(); int lowTapPosition = phaseTapChanger.getLowTapPosition(); int highTapPosition = phaseTapChanger.getHighTapPosition(); int tapNumber = phaseTapChanger.getStepCount(); double lowPositionAlpha = Math.toRadians(-phaseTapChanger.getStep(lowTapPosition).getAlpha()); double lowPositionRho = 1 / phaseTapChanger.getStep(lowTapPosition).getRho(); double highPositionAlpha = Math.toRadians(-phaseTapChanger.getStep(highTapPosition).getAlpha()); double highPositionRho = 1 / phaseTapChanger.getStep(highTapPosition).getRho(); double xa = lowPositionRho * Math.cos(lowPositionAlpha); double ya = lowPositionRho * Math.sin(lowPositionAlpha); double xb = highPositionRho * Math.cos(highPositionAlpha); double yb = highPositionRho * Math.sin(highPositionAlpha); double distance = Math.sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); double du = 100 * distance / (tapNumber - 1); return BigDecimal.valueOf(du).setScale(4, RoundingMode.HALF_UP).doubleValue(); } private  UcteConverterHelper(); static double calculatePhaseDu(TwoWindingsTransformer twoWindingsTransformer); static double calculateSymmAngleDu(TwoWindingsTransformer twoWindingsTransformer); static double calculateAsymmAngleDu(TwoWindingsTransformer twoWindingsTransformer); static double calculateAsymmAngleTheta(TwoWindingsTransformer twoWindingsTransformer);  }
@Test public void calculateAsymmAngleDuTest() { assertEquals(1.000, calculateAsymmAngleDu(reference.getTwoWindingsTransformer("HDDDDD2 HCCCCC1 1")), 0.0001); }