<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
    <attributes>
        <attribute name="name" value=""/>
        <attribute name="authors" value="kopecek"/>
        <attribute name="about" value=""/>
        <attribute name="saved" value="2020-04-01 12:19:49 dop."/>
        <attribute name="created" value="a29wZWNlaztVSzMzMC1QSzsyMDIwLTAyLTI1OzA0OjE3OjU3IG9kcC47Mjc0MQ=="/>
        <attribute name="edited" value="a29wZWNlaztVSzMzMC1QSzsyMDIwLTAyLTI2OzEwOjE5OjI4IGRvcC47MTI7Mjg5Nw=="/>
        <attribute name="edited" value="Zm94O0RFU0tUT1AtQTRBVE1MRjsyMDIwLTA0LTAxOzEyOjE5OjQ5IGRvcC47OTszMDEy"/>
    </attributes>
    <function name="Main" type="None" variable="">
        <parameters/>
        <body>
            <declare name="a, b, c, d" type="Real" array="False" size=""/>
            <output expression="&quot;V&#253;po&#269;et ko&#345;en&#367; kvadratick&#233; rovnice ax^2 + bx + c = 0:&quot;" newline="True"/>
            <comment text="V&#253;zva pro zad&#225;n&#237; koeficientu v kvadratick&#233;m &#269;lenu"/>
            <output expression="&quot;Zadejte a: &quot;" newline="False"/>
            <comment text="Na&#269;ten&#237; koeficientu v kvadratick&#233;m &#269;lenu"/>
            <input variable="a"/>
            <output expression="&quot;Zadejte b: &quot;" newline="False"/>
            <comment text="Na&#269;ten&#237; koeficientu v line&#225;rn&#237;m &#269;lenu"/>
            <input variable="b"/>
            <output expression="&quot;Zadejte c: &quot;" newline="False"/>
            <comment text="Na&#269;ten&#237; absolutn&#237;ho &#269;lenu"/>
            <input variable="c"/>
            <comment text="Pokud koeficient kvadratick&#233;ho &#269;lenu je roven nule potom..."/>
            <if expression="a == 0">
                <then>
                    <comment text="Vol&#225;n&#237; metody pro v&#253;po&#269;et line&#225;rni rovnice"/>
                    <call expression="LinearniRovnice(b,c)"/>
                </then>
                <else>
                    <comment text="V&#253;po&#269;et diskriminantu"/>
                    <assign variable="d" expression="b*b - 4*a*c"/>
                    <comment text="Pokud diskriminant nen&#237; roven nule, potom..."/>
                    <if expression="d != 0">
                        <then>
                            <comment text="Pokud diskriminant je v&#283;t&#353;&#237; ne&#382; nula, potom..."/>
                            <if expression="d &gt; 0">
                                <then>
                                    <comment text="Vol&#225;n&#237; podprogramu pro v&#253;po&#269;et re&#225;ln&#253;ch ko&#345;en&#367; kvadr. rovnice - p&#345;ed&#225;n&#237; parametr&#367;"/>
                                    <call expression="RealneKoreny(a,b,d)"/>
                                </then>
                                <else>
                                    <comment text="Vol&#225;ni podrpogramu pro v&#253;po&#269;et komplexn&#283; sdru&#382;en&#253;ch ko&#345;en&#367; kvadr. rovnice"/>
                                    <call expression="KomplexniKoreny(a, b, d)"/>
                                </else>
                            </if>
                        </then>
                        <else>
                            <comment text="Zavol&#225;ni podprogramu pro v&#253;po&#269;et dvojit&#233;ho ko&#345;enu"/>
                            <call expression="DvojityKoren(a, b)"/>
                        </else>
                    </if>
                </else>
            </if>
        </body>
    </function>
    <function name="DvojityKoren" type="None" variable="s">
        <parameters>
            <parameter name="a" type="Real" array="False"/>
            <parameter name="b" type="Real" array="False"/>
        </parameters>
        <body>
            <comment text="Deklarace: 'x' ... dvojit&#253; re&#225;ln&#253; ko&#345;en kvadr. rovnice"/>
            <declare name="x" type="Real" array="False" size=""/>
            <comment text="Vypo&#269;ten&#237; hodnoty dvojit&#233;ho re&#225;ln&#233;ho ko&#345;enu - vyps&#225;n&#237; textu"/>
            <output expression="&quot;Dvojit&#253; re&#225;ln&#253; ko&#345;en je: x = &quot; &amp; ToString(-b / (2*a))" newline="True"/>
        </body>
    </function>
    <function name="KomplexniKoreny" type="None" variable="s">
        <parameters>
            <parameter name="a" type="Real" array="False"/>
            <parameter name="b" type="Real" array="False"/>
            <parameter name="d" type="Real" array="False"/>
        </parameters>
        <body>
            <comment text="Deklarace: 're' ... re&#225;ln&#225; slo&#382;ka ko&#345;enu kvadr. rovnice; 'im' ... imagin&#225;rn&#237; slo&#382;ka ko&#345;enu kvadr. rovnice"/>
            <declare name="re, im" type="Real" array="False" size=""/>
            <comment text="V&#253;po&#269;et re&#225;ln&#233; slo&#382;ky ko&#345;enu kvadr. rovnice"/>
            <assign variable="re" expression="-b / (2*a)"/>
            <comment text="V&#253;po&#269;et imagin&#225;rn&#237; slo&#382;ky ko&#345;enu kvadr. rovnice"/>
            <assign variable="im" expression="sqrt(-d) / (2*a)"/>
            <comment text="V&#253;pis hodnot komplextn&#237;ch ko&#345;en&#367; - vyps&#225;n&#237; textu"/>
            <output expression="&quot;Ko&#345;eny jsou komplexn&#237;: x1 = &quot; &amp; ToString(re) &amp; &quot; + &quot; &amp; ToString(im) &amp; &quot;i&quot; &amp; &quot;; x2 = &quot; &amp; ToString(re) &amp; &quot; - &quot; &amp; ToString(im) &amp; &quot;i&quot;" newline="True"/>
        </body>
    </function>
    <function name="LinearniRovnice" type="None" variable="s">
        <parameters>
            <parameter name="b" type="Real" array="False"/>
            <parameter name="c" type="Real" array="False"/>
        </parameters>
        <body>
            <comment text="Line&#225;rn&#237; rovnice: b*x + c = 0"/>
            <comment text="Pokud prvn&#237; parametr je roven nule potom..."/>
            <if expression="b = 0">
                <then>
                    <comment text="Pokud druh&#253; parametr je roven 0 potom..."/>
                    <if expression="c = 0">
                        <then>
                            <comment text="Nekone&#269;n&#283; mnoho &#345;e&#353;en&#237; - vyps&#225;n&#237; textu"/>
                            <output expression="&quot;Nekone&#269;n&#283; mnoho &#345;e&#353;en&#237; - ka&#382;d&#233; x&quot;" newline="True"/>
                        </then>
                        <else>
                            <comment text="&#381;&#225;dn&#233; &#345;e&#353;en&#237; - vyps&#225;n&#237; textu"/>
                            <output expression="&quot;&#381;&#225;dn&#233; &#345;e&#353;en&#237; - &#382;&#225;dn&#233; x&quot;" newline="True"/>
                        </else>
                    </if>
                </then>
                <else>
                    <comment text="Vyps&#225;n&#237; textu spolu s vypo&#269;tenou hodnotou ko&#345;enu"/>
                    <output expression="&quot;Line&#225;rn&#237; rovnice - ko&#345;en je: x = &quot; &amp; (-c / b)" newline="True"/>
                </else>
            </if>
        </body>
    </function>
    <function name="RealneKoreny" type="None" variable="s">
        <parameters>
            <parameter name="a" type="Real" array="False"/>
            <parameter name="b" type="Real" array="False"/>
            <parameter name="d" type="Real" array="False"/>
        </parameters>
        <body>
            <comment text="Deklarace: 'x1' ... prvn&#237; re&#225;ln&#253; ko&#345;en kvadr. rovnice; 'x2' ... druh&#253; re&#225;ln&#253; ko&#345;en kvadr. rovnice"/>
            <declare name="x1, x2" type="Real" array="False" size=""/>
            <comment text="V&#253;po&#269;et prvn&#237;ho ko&#345;enu"/>
            <assign variable="x1" expression="(-b + sqrt(d)) / (2*a)"/>
            <comment text="V&#253;po&#269;et druh&#233;ho ko&#345;enu"/>
            <assign variable="x2" expression="(-b - sqrt(d)) / (2*a)"/>
            <comment text="Vypo&#269;ten&#237; hodnot ko&#345;en&#367; - vyps&#225;n&#237; textu"/>
            <output expression="&quot;Ko&#345;eny jsou: x1 = &quot; &amp; ToString(x1) &amp; &quot;; x2 = &quot; &amp; ToString(x2)" newline="True"/>
        </body>
    </function>
</flowgorithm>
