public ComplexMatrix getABCDmatrix(){
        if(this.segmentLength==-1)throw new IllegalArgumentException("No distance along the line as been entered");
        if(this.distributedResistance==0.0D && this.distributedConductance==0.0D){
            this.generalABCDmatrix = this.getIdealABCDmatrix();
        }
        else{
            this.generalABCDmatrix = new ComplexMatrix(2,2);
            Complex gammal = this.getPropagationConstant().times(this.segmentLength);
            Complex zed0 = this.getCharacteristicImpedance();
            this.generalABCDmatrix.setElement(0, 0, Complex.cosh(gammal));
            this.generalABCDmatrix.setElement(0, 1, Complex.sinh(gammal).times(zed0));
            this.generalABCDmatrix.setElement(1, 0, Complex.sinh(gammal).over(zed0));
            this.generalABCDmatrix.setElement(1, 1, Complex.cosh(gammal));
        }
        return this.generalABCDmatrix;
    }