protected override Polygon GetConnectingRodView(PositionedCylinder _positionedCylinder, double _crankshaftRotation_deg) { double _absoluteCrankThrowRotation_deg = _positionedCylinder.GetAbsoluteCrankThrowRotation_deg(_crankshaftRotation_deg); double _absoluteCrankThrowRotation_rad = Conversions.DegToRad(_absoluteCrankThrowRotation_deg); double _cylinderRelativeCrankThrowRotation_deg = _positionedCylinder.GetCylinderRelativeCrankThrowRotation_deg(_crankshaftRotation_deg); double _pistonTravelFromCeter_mm = _positionedCylinder.GetPistonTravelFromCrankCenter_mm(_cylinderRelativeCrankThrowRotation_deg); double _offset_rad = Conversions.DegToRad(_positionedCylinder.Tilt_deg); //zgornja točka ojnice double _xTDC = (Math.Sin(_offset_rad) * _pistonTravelFromCeter_mm); double _yTDC = (Math.Cos(_offset_rad) * _pistonTravelFromCeter_mm); //spodnja točka ojnice double _xBDC = (Math.Sin(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm); double _yBDC = (Math.Cos(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm); return(Polygon.Line(_xTDC, _yTDC, _xBDC, _yBDC)); }
protected override Polygon GetConnectingRodView(PositionedCylinder _positionedCylinder, double _crankshaftRotation_deg) { double _cylinderRelativeCrankThrowRotation_deg = _positionedCylinder.GetCylinderRelativeCrankThrowRotation_deg(_crankshaftRotation_deg); double _offset_rad = Conversions.DegToRad(_positionedCylinder.Tilt_deg); double _cosOffset = Math.Cos(_offset_rad); double _pistonTravelFromCeter_mm = _positionedCylinder.GetPistonTravelFromCrankCenter_mm(_cylinderRelativeCrankThrowRotation_deg); double _absoluteCrankThrowRotation_deg = _positionedCylinder.GetAbsoluteCrankThrowRotation_deg(_crankshaftRotation_deg); double _absoluteCrankThrowRotation_rad = Conversions.DegToRad(_absoluteCrankThrowRotation_deg); double _TDC = (_cosOffset * _pistonTravelFromCeter_mm); double _BDC = (Math.Cos(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm); return(Polygon.Line( _positionedCylinder.Offset_mm, _TDC, _positionedCylinder.Offset_mm, _BDC)); }