1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

Hipotenuse-it

Discussão em 'Programação' iniciada por n0stress, 5 de Fevereiro de 2009. (Respostas: 2; Visualizações: 546)

  1. Descriçao

    Bem, Sei que é um programa facil de fazer e lala, mas prontos, este programa serve para calcular para voce, o valor de uma hipotenusa, bem simples..

    Screenshot's

    [​IMG]

    [​IMG]

    Download

    http://rapidshare.com/files/193067245/hipotenuse-it.zip

    Código:
    [COLOR=#808080][I]// By Me![/I][/COLOR]
    [COLOR=#808080][I]// Hipotunese-it[/I][/COLOR]
    [COLOR=#808080][I]// 2.Fev.2009[/I][/COLOR]
     
    [COLOR=#000000][B]unit[/B][/COLOR] Unit1[COLOR=#000066];[/COLOR]
     
    [COLOR=#000000][B]interface[/B][/COLOR]
     
    [COLOR=#000000][B]uses[/B][/COLOR]
      Windows[COLOR=#000066],[/COLOR] Messages[COLOR=#000066],[/COLOR] SysUtils[COLOR=#000066],[/COLOR] Variants[COLOR=#000066],[/COLOR] Classes[COLOR=#000066],[/COLOR] Graphics[COLOR=#000066],[/COLOR] Controls[COLOR=#000066],[/COLOR] Forms[COLOR=#000066],[/COLOR]
      Dialogs[COLOR=#000066],[/COLOR] ComCtrls[COLOR=#000066],[/COLOR] StdCtrls[COLOR=#000066],[/COLOR] XPMan[COLOR=#000066],[/COLOR] jpeg[COLOR=#000066],[/COLOR] ExtCtrls[COLOR=#000066];[/COLOR]
     
    [COLOR=#000000][B]type[/B][/COLOR]
      TForm1 [COLOR=#000066]=[/COLOR] [COLOR=#000000][B]class[/B][/COLOR][COLOR=#000066]([/COLOR]TForm[COLOR=#000066])[/COLOR]
        PageControl1[COLOR=#000066]:[/COLOR] TPageControl[COLOR=#000066];[/COLOR]
        TabSheet1[COLOR=#000066]:[/COLOR] TTabSheet[COLOR=#000066];[/COLOR]
        GroupBox1[COLOR=#000066]:[/COLOR] TGroupBox[COLOR=#000066];[/COLOR]
        Label1[COLOR=#000066]:[/COLOR] TLabel[COLOR=#000066];[/COLOR]
        Edit1[COLOR=#000066]:[/COLOR] TEdit[COLOR=#000066];[/COLOR]
        TabSheet2[COLOR=#000066]:[/COLOR] TTabSheet[COLOR=#000066];[/COLOR]
        Label2[COLOR=#000066]:[/COLOR] TLabel[COLOR=#000066];[/COLOR]
        Edit2[COLOR=#000066]:[/COLOR] TEdit[COLOR=#000066];[/COLOR]
        XPManifest1[COLOR=#000066]:[/COLOR] TXPManifest[COLOR=#000066];[/COLOR]
        GroupBox2[COLOR=#000066]:[/COLOR] TGroupBox[COLOR=#000066];[/COLOR]
        Memo1[COLOR=#000066]:[/COLOR] TMemo[COLOR=#000066];[/COLOR]
        Button1[COLOR=#000066]:[/COLOR] TButton[COLOR=#000066];[/COLOR]
        Button2[COLOR=#000066]:[/COLOR] TButton[COLOR=#000066];[/COLOR]
        Image1[COLOR=#000066]:[/COLOR] TImage[COLOR=#000066];[/COLOR]
        Label3[COLOR=#000066]:[/COLOR] TLabel[COLOR=#000066];[/COLOR]
        Image2[COLOR=#000066]:[/COLOR] TImage[COLOR=#000066];[/COLOR]
        Label4[COLOR=#000066]:[/COLOR] TLabel[COLOR=#000066];[/COLOR]
        Label5[COLOR=#000066]:[/COLOR] TLabel[COLOR=#000066];[/COLOR]
        Image3[COLOR=#000066]:[/COLOR] TImage[COLOR=#000066];[/COLOR]
        [COLOR=#000000][B]procedure[/B][/COLOR] Button1Click[COLOR=#000066]([/COLOR]Sender[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]TObject[/B][/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
        [COLOR=#000000][B]procedure[/B][/COLOR] Button2Click[COLOR=#000066]([/COLOR]Sender[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]TObject[/B][/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
      [COLOR=#000000][B]private[/B][/COLOR]
        [COLOR=#808080][I]{ Private declarations }[/I][/COLOR]
      [COLOR=#000000][B]public[/B][/COLOR]
        [COLOR=#808080][I]{ Public declarations }[/I][/COLOR]
      [COLOR=#000000][B]end[/B][/COLOR][COLOR=#000066];[/COLOR]
     
    [COLOR=#000000][B]var[/B][/COLOR]
      Form1[COLOR=#000066]:[/COLOR] TForm1[COLOR=#000066];[/COLOR]
     
    [COLOR=#000000][B]implementation[/B][/COLOR]
     
    [COLOR=#008000][I]{$R *.dfm}[/I][/COLOR]
     
    [COLOR=#000000][B]procedure[/B][/COLOR] TForm1[COLOR=#000066].[/COLOR][COLOR=#006600]Button1Click[/COLOR][COLOR=#000066]([/COLOR]Sender[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]TObject[/B][/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    [COLOR=#000000][B]var[/B][/COLOR]
    cc1[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]string[/B][/COLOR][COLOR=#000066];[/COLOR]
    cc2[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]string[/B][/COLOR][COLOR=#000066];[/COLOR]
    c1[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]real[/B][/COLOR][COLOR=#000066];[/COLOR]
    c2[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]real[/B][/COLOR][COLOR=#000066];[/COLOR]
    val1[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]real[/B][/COLOR][COLOR=#000066];[/COLOR]
    val2[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]real[/B][/COLOR][COLOR=#000066];[/COLOR]
    vall[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]string[/B][/COLOR][COLOR=#000066];[/COLOR]
    vall1[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]string[/B][/COLOR][COLOR=#000066];[/COLOR]
    hnn[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]string[/B][/COLOR][COLOR=#000066];[/COLOR]
    hc[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]string[/B][/COLOR][COLOR=#000066];[/COLOR]
    hn[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]real[/B][/COLOR][COLOR=#000066];[/COLOR]
    h[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]real[/B][/COLOR][COLOR=#000066];[/COLOR]
    [COLOR=#000000][B]begin[/B][/COLOR]
    Button1[COLOR=#000066].[/COLOR][COLOR=#006600]Enabled[/COLOR][COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000000][B]False[/B][/COLOR][COLOR=#000066];[/COLOR]
    cc1[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] Edit1[COLOR=#000066].[/COLOR][COLOR=#006600]Text[/COLOR][COLOR=#000066];[/COLOR]
    cc2[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] Edit2[COLOR=#000066].[/COLOR][COLOR=#006600]Text[/COLOR][COLOR=#000066];[/COLOR]
    c1[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]StrToFloat[/COLOR][COLOR=#000066]([/COLOR]cc1[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    c2[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]StrToFloat[/COLOR][COLOR=#000066]([/COLOR]cc2[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    val1[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]([/COLOR]c1[COLOR=#000066]*[/COLOR]c1[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    val2[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]([/COLOR]c2[COLOR=#000066]*[/COLOR]c2[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    vall[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]([/COLOR][COLOR=#000066]FloatToStr[/COLOR][COLOR=#000066]([/COLOR]val1[COLOR=#000066])[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    vall1[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]([/COLOR][COLOR=#000066]FloatToStr[/COLOR][COLOR=#000066]([/COLOR]val2[COLOR=#000066])[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    hn[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]([/COLOR]c1[COLOR=#000066]*[/COLOR]c1[COLOR=#000066]+[/COLOR]c2[COLOR=#000066]*[/COLOR]c2[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    hnn[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]([/COLOR][COLOR=#000066]FloatToStr[/COLOR][COLOR=#000066]([/COLOR]hn[COLOR=#000066])[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    h[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR][COLOR=#000066]sqrt[/COLOR][COLOR=#000066]([/COLOR]c1[COLOR=#000066]*[/COLOR]c1[COLOR=#000066]+[/COLOR]c2[COLOR=#000066]*[/COLOR]c2[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    hc[COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000066]([/COLOR][COLOR=#000066]FloatTOStr[/COLOR][COLOR=#000066]([/COLOR]h[COLOR=#000066])[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Add[/COLOR][COLOR=#000066]([/COLOR][COLOR=#ff0000]'h² = '[/COLOR] [COLOR=#000066]+[/COLOR] cc1 [COLOR=#000066]+[/COLOR] [COLOR=#ff0000]'² + '[/COLOR] [COLOR=#000066]+[/COLOR] cc2 [COLOR=#000066]+[/COLOR] [COLOR=#ff0000]'²'[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Add[/COLOR][COLOR=#000066]([/COLOR][COLOR=#ff0000]'h² = '[/COLOR] [COLOR=#000066]+[/COLOR] vall [COLOR=#000066]+[/COLOR] [COLOR=#ff0000]' + '[/COLOR] [COLOR=#000066]+[/COLOR] vall1[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Add[/COLOR][COLOR=#000066]([/COLOR][COLOR=#ff0000]'h = '[/COLOR] [COLOR=#000066]+[/COLOR] [COLOR=#ff0000]#32[/COLOR][COLOR=#ff0000]#35[/COLOR] [COLOR=#000066]+[/COLOR] [COLOR=#ff0000]' '[/COLOR] [COLOR=#000066]+[/COLOR] hnn[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Add[/COLOR][COLOR=#000066]([/COLOR][COLOR=#ff0000]'h = '[/COLOR] [COLOR=#000066]+[/COLOR] hc[COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Add[/COLOR][COLOR=#000066]([/COLOR][COLOR=#ff0000]''[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Add[/COLOR][COLOR=#000066]([/COLOR][COLOR=#ff0000]''[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Add[/COLOR][COLOR=#000066]([/COLOR][COLOR=#ff0000]'# - Equivale Ao Simbolo Da Raiz Quadrada'[/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Enabled[/COLOR][COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000000][B]True[/B][/COLOR][COLOR=#000066];[/COLOR]
     
     
    [COLOR=#000000][B]end[/B][/COLOR][COLOR=#000066];[/COLOR]
     
    [COLOR=#000000][B]procedure[/B][/COLOR] TForm1[COLOR=#000066].[/COLOR][COLOR=#006600]Button2Click[/COLOR][COLOR=#000066]([/COLOR]Sender[COLOR=#000066]:[/COLOR] [COLOR=#000066][B]TObject[/B][/COLOR][COLOR=#000066])[/COLOR][COLOR=#000066];[/COLOR]
    [COLOR=#000000][B]begin[/B][/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Lines[/COLOR][COLOR=#000066].[/COLOR][COLOR=#006600]Clear[/COLOR][COLOR=#000066];[/COLOR]
    Memo1[COLOR=#000066].[/COLOR][COLOR=#006600]Enabled[/COLOR][COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000000][B]False[/B][/COLOR][COLOR=#000066];[/COLOR]
    Button2[COLOR=#000066].[/COLOR][COLOR=#006600]Enabled[/COLOR][COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000000][B]False[/B][/COLOR][COLOR=#000066];[/COLOR]
    Button2[COLOR=#000066].[/COLOR][COLOR=#006600]Enabled[/COLOR][COLOR=#000066]:[/COLOR][COLOR=#000066]=[/COLOR] [COLOR=#000000][B]True[/B][/COLOR][COLOR=#000066];[/COLOR]
    [COLOR=#000000][B]end[/B][/COLOR][COLOR=#000066];[/COLOR]
     
    [COLOR=#000000][B]end[/B][/COLOR][COLOR=#000066].[/COLOR]
     
     
  2. Mach4_PT

    Mach4_PT Power Member

    Engraçado engraçado era fazeres isso descobrir um cateto dando o outro cateto e a hipotenusa, ou então calcular qualquer um dos lados dando alguns comprimentos e uns ângulos :)
     
  3. Basta predifinir as regras -.-, mas n me apetece :003:
     

Partilhar esta Página