BorderGame

Versione completa: domanda
Al momento stai visualizzando i contenuti in una versione ridotta. Visualizza la versione completa e formattata.
ciao a tutti ragazzi :O
sto facendo un programma per calcolare lati, altezze, perimetro e area di un triangolo.
mi serve solo sapere come imposto la funzione dell'area ..
(per i nerdoni che sono tentati di scrivere bxh/2 sappiano che sbagliano si deve usare l'algoritmo di erone... )
il mio problema è che non so impostare questo algoritmo in autoit..
Codice:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Triangolo - SISEL", 436, 303, 384, 198)
$Label1 = GUICtrlCreateLabel("a", 8, 8, 10, 17)
$Input1 = GUICtrlCreateInput("Input1", 8, 24, 121, 21)
$Label2 = GUICtrlCreateLabel("b", 8, 64, 10, 17)
$Input2 = GUICtrlCreateInput("Input2", 8, 80, 121, 21)
$Label3 = GUICtrlCreateLabel("c", 8, 112, 10, 17)
$Input3 = GUICtrlCreateInput("Input3", 8, 128, 121, 21)
$Pic1 = GUICtrlCreatePic("C:\Users\Valentina\Desktop\Luca\Cattura.JPG", 136, 24, 284, 180, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Input4 = GUICtrlCreateInput("Input4", 8, 192, 121, 21)
$Label4 = GUICtrlCreateLabel("---------------------------------------", 8, 160, 121, 17)
$Label5 = GUICtrlCreateLabel("perimetro", 8, 176, 47, 17)
$Label6 = GUICtrlCreateLabel("H rispetto a", 8, 216, 58, 17)
$Input5 = GUICtrlCreateInput("Input5", 8, 232, 121, 21)
$Label7 = GUICtrlCreateLabel("H rispetto b", 144, 216, 58, 17)
$Input6 = GUICtrlCreateInput("Input6", 144, 232, 121, 21)
$Label8 = GUICtrlCreateLabel("H rispetto c", 280, 216, 58, 17)
$Input7 = GUICtrlCreateInput("Input7", 280, 232, 121, 21)
$Label9 = GUICtrlCreateLabel("area", 8, 256, 25, 17)
$Input8 = GUICtrlCreateInput("Input8", 8, 272, 121, 21)
$Button1 = GUICtrlCreateButton("Esci", 136, 272, 283, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
İmage

su autoit sicuramente ci sarà la radice quadrata e anche il resto
so com'è l'algoritmo, non so come si immette la radq ..
Sqrt
$a = GuiCtrlRead($Input1)
$b = GuiCtrlRead($Input2)
$c = GuiCtrlRead($Input3)
Sqrt((($a + $b + $c) * (- $a + $b + $c) * ($a -$b + $c) * ($a + $b - $c)) / 4)

Non ci voleva tanto <.<
grazie mille ^^, si può chiudere.
URL di riferimento