Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 27
  1. #1

    aiuto!!! programmino Geometria Analitica (Parabola)

    ciao a tutti ho apperto questa discussione per chiedere a tutti due cose alcune java.
    1) cosigli
    2) un codice
    3)cosa aggiungere
    4) come perferzionare
    5) guide nel web
    6) guida immediata e dettagliata.
    io non riesco a finire un programmino sulla geometria analitica (La Parabola) sapendo le regole di matematica ho ragionato e pensato di creare un programmino per creare una parabola solo che è po' che mi sono bloccato perchè mi manca un codice per usare una label per iserirci un icona creata da paint cosi ogni caso ho il suo disegno. praticamente direi di aver finito ma ci vorrei aggiungere tale codice che secondo me rende il programmino più bello dal punto di vista grafico non solo un programma piùcompleto.
    qui sotto è il lavoro fatto fin ora seguendo l'elenco qui sopra vorrei gentilmente e presto risposte inoltre come consigli vorrei sapere se è possibile o meno usare i cicli tipo il while e il for alposto dei if che ho messo perchè io c'è li metterei ma nn so se puo mi funziona il programma anche perchè non li sto gestire molto bene perchè sn alle prime armi e vorrei semplicare il codice usato ma nn so come farlo. scs gli errori di grammatica.
    codice:
     private void ParabolaActionPerformed(java.awt.event.ActionEvent evt) { 
    Double A = new Double (txtA.getText());
    Double B = new Double (txtB.getText());
    Double C = new Double (txtC.getText());
    String AsseX = " Y = 0.0 " ;
    String AsseY = " X = 0.0 " ;
    String Origine = " 0.0 ; 0.0 ";
    if(A!=0.0){
    if(A>=0.0)
    {
    Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
    if(Delta<0.0)
    {
    Double X1 = 0.0;
    Double X2 = 0.0;
    Double YV = new Double(-(Delta)) / (4.0 * A);
    Double XF = new Double(-B) / (2.0 * A);
    Double YF = new Double(-(Delta) / (4.0 * A)) + (1.0 / (4.0 * A));
    txtF.setText(XF.toString() + "" + ";" + YF.toString());
    txtV.setText(XF.toString() + "" + ";" + YV.toString());
    txtD.setText("Y" + "" + "=" + XF.toString() + "" + "-" + YF.toString());
    txtASimm.setText("X" + "" + "=" + XF.toString());
    txtConcavita.setText("Parabola con Concavita verso l'alto");
    Double AX1 = new Double(A * (Math.pow(X1, 2.0)));
    Double BX2 = new Double(A * (Math.pow(X2, 1.0)));
    txtP.setText("Y" + "" + "=" + AX1.toString() + "" + "+" + BX2.toString() + "" + "+" + C.toString());
    txtintX1.setText(X1.toString() + "" + ";" + "0");
    txtintX2.setText(X2.toString() + "" + ";" + "0");
    txtintY.setText("0" + "" + ";" + "" + C.toString());
    txtintD.setText("Parabola Esterna");
    }
    else if (Delta ==0.0)
    {
    Double X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
    Double X2 = X1;
    Double YV = new Double (-(Delta))/(4.0*A);
    Double XF = new Double(-B)/(2.0*A);
    Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
    txtF.setText(XF.toString() +"" +";"+YF.toString());
    txtV.setText(XF.toString()+""+";"+YV.toString());
    txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
    txtASimm.setText("X"+""+"="+XF.toString());
    txtConcavita.setText("Parabola con Concavita verso l'alto");
    Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
    Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
    txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
    txtintX1.setText(X1.toString()+""+";"+"0");
    txtintX2.setText(X2.toString()+""+";"+"0");
    txtintY.setText("0"+""+";"+""+C.toString());
    txtintD.setText("Parabola Seccante");
    }
    else if(Delta >0)
    {
    Double X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
    Double X2 = new Double((-B)-(Math.pow(Delta, 0.5)))/(2.0*A);
    Double YV = new Double (-(Delta))/(4.0*A);
    Double XF = new Double(-B)/(2.0*A);
    Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
    txtF.setText(XF.toString() +"" +";"+YF.toString());
    txtV.setText(XF.toString()+""+";"+YV.toString());
    txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
    txtASimm.setText("X"+""+"="+XF.toString());
    txtConcavita.setText("Parabola con Concavita verso l'alto");
    Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
    Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
    txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
    txtintX1.setText(X1.toString()+""+";"+"0");
    txtintX2.setText(X2.toString()+""+";"+"0");
    txtintY.setText("0"+""+";"+""+C.toString());
    txtintD.setText("Parabola Tagente");
    }
    }else{
    Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
    if(Delta<0.0)
    {
    Double X1=0.0;
    Double X2=0.0;
    Double YV = new Double (-(Delta))/(4.0*A);
    Double XF = new Double(-B)/(2.0*A);
    Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
    txtF.setText(XF.toString() +"" +";"+YF.toString());
    txtV.setText(XF.toString()+""+";"+YV.toString());
    txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
    txtASimm.setText("X"+""+"="+XF.toString());
    txtConcavita.setText("Parabola con Concavita verso il basso");
    Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
    Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
    txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
    txtintX1.setText(X1.toString()+""+";"+"0");
    txtintX2.setText(X2.toString()+""+";"+"0");
    txtintY.setText("0"+""+";"+""+C.toString());
    txtintD.setText("Parabola Esterna");
    }
    else if (Delta ==0.0)
    {
    Double X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
    Double X2 = X1;
    Double YV = new Double (-(Delta))/(4.0*A);
    Double XF = new Double(-B)/(2.0*A);
    Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
    txtF.setText(XF.toString() +"" +";"+YF.toString());
    txtV.setText(XF.toString()+""+";"+YV.toString());
    txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
    txtASimm.setText("X"+""+"="+XF.toString());
    txtConcavita.setText("Parabola con Concavita verso il basso");
    Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
    Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
    txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
    txtintX1.setText(X1.toString()+""+";"+"0");
    txtintX2.setText(X2.toString()+""+";"+"0");
    txtintY.setText("0"+""+";"+""+C.toString());
    txtintD.setText("Parabola Seccante");
    }
    else if(Delta >0)
    {
    Double X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
    Double X2 = new Double((-B)-(Math.pow(Delta, 0.5)))/(2.0*A);
    Double YV = new Double (-(Delta))/(4.0*A);
    Double XF = new Double(-B)/(2.0*A);
    Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
    txtF.setText(XF.toString() +"" +";"+YF.toString());
    txtV.setText(XF.toString()+""+";"+YV.toString());
    txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
    txtASimm.setText("X"+""+"="+XF.toString());
    txtConcavita.setText("Parabola con Concavita verso il basso");
    Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
    Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
    txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
    txtintX1.setText(X1.toString()+""+";"+"0");
    txtintX2.setText(X2.toString()+""+";"+"0");
    txtintY.setText("0"+""+";"+""+C.toString());
    txtintD.setText("Parabola Tagente");
    }
    }
    }else
    {
    txtA.setText("");
    txtB.setText("");
    txtC.setText("");
    txtD.setText("");
    txtintD.setText("");
    txtintX1.setText("");
    txtintX2.setText("");
    txtintY.setText("");
    txtV.setText("");
    txtF.setText("");
    txtP.setText("");
    txtASimm.setText("");
    }
    } 
    }
    ditemi se c'è qualcosa che manca oltre ai disegni per completare e perferzionare il programma. sopratutto codici.... magari come sostituire uno più switch per il delta al posto degli if.

    ho rimesso la stessa guida senza sondaggio perchè ho avuto molte lamentele nella compressione della mia discussione spero che quest'ultima modifica della discussione sia compressibile che dire avoi i commenti.


    premetto che molto codice di non lo conosco soppratutto non so se incide nella creazione del programma molte istruzioni ho usato il mouse per crearle o meglio per creare tale programma uso netbeans se lo conoscete mandatemi dei consigli su come usare meglio netbeans versione 6.8.1 in pratica molto è grazie ad esso il resto è conoscenza matematica forse scarsa ma forse quello che serve per il programma.

  2. #2
    non aprire doppie discussioni

    l'hai già aperta qui una simile se non identica

  3. #3
    Moderatore di Programmazione L'avatar di LeleFT
    Registrato dal
    Jun 2003
    Messaggi
    17,317
    Originariamente inviato da Naruto 92
    non aprire doppie discussioni

    l'hai già aperta qui una simile se non identica
    L'altra è stata correttamente chiusa. Va bene questa.


    Ciao.
    "Perchè spendere anche solo 5 dollari per un S.O., quando posso averne uno gratis e spendere quei 5 dollari per 5 bottiglie di birra?" [Jon "maddog" Hall]
    Fatti non foste a viver come bruti, ma per seguir virtute e canoscenza

  4. #4
    Originariamente inviato da Naruto 92
    non aprire doppie discussioni

    lo fatto apposta x avere delle risposte xk ne ho bisogno e poi l'ho scritto ke ho rimesso la discussione oltre ke è stata chiusa ma vedo ke questa sia apposto.

    l'hai già aperta qui una simile se non identica

  5. #5
    Originariamente inviato da Naruto 92
    non aprire doppie discussioni
    questa è simile anzi uguale xk ho solo modificato l'italiano senza abbreviazioni e indacato dov'è il codice.
    l'hai già aperta qui una simile se non identica

  6. #6
    Originariamente inviato da LeleFT
    L'altra è stata correttamente chiusa. Va bene questa.

    ciao e grazie.
    Ciao.

  7. #7

    vorrei risposte

    vorrei una risposta ditemi qualcosa sulla mia discussione magari sbaglio qualche codice non conosco bene il JAVA e devo solo modificare alcune cose che non so che non mi fanno vizualizare immagini comunque qui sotto ho altro codice cosi potete analizare meglio la situazione.
    questo prima del bottone:
    codice:
    idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
    pae = resourceMap.getIcon("StatusBar.pae");
    pas = resourceMap.getIcon("StatusBar.pas");
    pat = resourceMap.getIcon("StatusBar.par");
    pbe = resourceMap.getIcon("StatusBar.pbe");
    pbs = resourceMap.getIcon("StatusBar.pbs");
    pbt = resourceMap.getIcon("StatusBar.pbt");
    statusAnimationLabel.setIcon(idleIcon);
    statusAnimationLabel.setIcon(pae);
    statusAnimationLabel.setIcon(pas);
    statusAnimationLabel.setIcon(pat);
    statusAnimationLabel.setIcon(pbe);
    statusAnimationLabel.setIcon(pbs);
    statusAnimationLabel.setIcon(pbt);
    questo sotto il bottone:
    codice:
        private final Timer messageTimer;
        private final Timer busyIconTimer;
        private final Icon idleIcon;
        private final Icon[] busyIcons = new Icon[15];
        private int busyIconIndex = 0;
        private JDialog aboutBox;
        private final Icon pae;
        private final Icon pas;
        private final Icon pat;
        private final Icon pbe;
        private final Icon pbs;
        private final Icon pbt;

  8. #8

    Re: vorrei risposte

    Originariamente inviato da Cracker1992
    vorrei una risposta ditemi qualcosa sulla mia discussione magari sbaglio qualche codice non conosco bene il JAVA e devo solo modificare alcune cose che non so che non mi fanno vizualizare immagini comunque qui sotto ho altro codice cosi potete analizare meglio la situazione.
    questo prima del bottone:
    codice:
    idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
    pae = resourceMap.getIcon("StatusBar.pae");
    pas = resourceMap.getIcon("StatusBar.pas");
    pat = resourceMap.getIcon("StatusBar.par");
    pbe = resourceMap.getIcon("StatusBar.pbe");
    pbs = resourceMap.getIcon("StatusBar.pbs");
    pbt = resourceMap.getIcon("StatusBar.pbt");
    statusAnimationLabel.setIcon(idleIcon);
    statusAnimationLabel.setIcon(pae);
    statusAnimationLabel.setIcon(pas);
    statusAnimationLabel.setIcon(pat);
    statusAnimationLabel.setIcon(pbe);
    statusAnimationLabel.setIcon(pbs);
    statusAnimationLabel.setIcon(pbt);
    questo sotto il bottone:
    codice:
        private final Timer messageTimer;
        private final Timer busyIconTimer;
        private final Icon idleIcon;
        private final Icon[] busyIcons = new Icon[15];
        private int busyIconIndex = 0;
        private JDialog aboutBox;
        private final Icon pae;
        private final Icon pas;
        private final Icon pat;
        private final Icon pbe;
        private final Icon pbs;
        private final Icon pbt;
    dopo tutto questo codice mi sono fermato come vado avanti vorrei usare le icone e una label se si puo se usero altro per far vizualizare nel mio programma tali icone che rispetivamente rappresentano le 6 paraboli possibili che sono previste nel mio programma ovvero:
    pae=parabola in alto esterna
    pat = parabola in alto tangente
    pas = parabola in alto seccante
    pbs = parabola in basso seccante
    pbt = parabola in basso tangente
    pbe = parabola in basso esterna
    sono i 6 file creati con pain trasformati in jpg per farne un formato icona cs le potrei usare nel java e le poi incolate nella cartella del progetto busyinconindex una cosa del genere comunque quella dove sono contenute le icone. dopo aver fatto tutto mi sono trovato appunto il problema del non sapere il codice per usarle come desidero io ovvero vorrei chei il mio programma che tral'altro provandolo è funzionante alla fine dopo il click del bottone vorrei che uscisse fuori il disegno della parabola cosi ho anche la soluzione grafica pero tali codici non li so infatti chiedo qua per completare il mio programma e per farlo come faccio??
    sarebbe più figo se mi date una risposta ancora più arguta in quanto se sapete un codice migliore invece di far usare una mia immagine un codice he crei un immagine automatica leggendo i codici sopra per le parabole.

  9. #9

    Spiegazione

    codice:
    l
    blDP.
    lblDP=la label che vorrei usare .= richiamo metodi (giusto?)
    dopo che metodo uso per il mio obbietivo descritto nei precendi messaggi
    e che parametri uso se devo usare parametri come faccio a indicare e usare una delle 6 parabole da paint in modo tale da rispetare gli if nei precendenti codici.
    come faccio?
    codice:
     
    
     private void ParabolaActionPerformed(java.awt.event.ActionEvent evt) { 
    
     Double A = new Double (txtA.getText());
           Double B = new Double (txtB.getText());
           Double C = new Double (txtC.getText());
           String AsseX = " Y =  0.0 " ;
           String AsseY = " X = 0.0 " ;
           String Origine = " 0.0 ; 0.0 ";
           if(A!=0.0){
             if(A>=0.0)
           {
               Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
               if(Delta<0.0)
               {
               Double X1 = 0.0;
               Double X2 = 0.0;
               Double YV = new Double(-(Delta)) / (4.0 * A);
               Double XF = new Double(-B) / (2.0 * A);
               Double YF = new Double(-(Delta) / (4.0 * A)) + (1.0 / (4.0 * A));
               txtF.setText(XF.toString() + "" + ";" + YF.toString());
               txtV.setText(XF.toString() + "" + ";" + YV.toString());
               txtD.setText("Y" + "" + "=" + XF.toString() + "" + "-" + YF.toString());
               txtASimm.setText("X" + "" + "=" + XF.toString());
               txtConcavita.setText("Parabola con Concavita verso l'alto");
               Double AX1 = new Double(A * (Math.pow(X1, 2.0)));
               Double BX2 = new Double(A * (Math.pow(X2, 1.0)));
               txtP.setText("Y" + "" + "=" + AX1.toString() + "" + "+" + BX2.toString() + "" + "+" + C.toString());
               txtintX1.setText(X1.toString() + "" + ";" + "0");
               txtintX2.setText(X2.toString() + "" + ";" + "0");
               txtintY.setText("0" + "" + ";" + "" + C.toString());
               txtintD.setText("Parabola Esterna");
               }
               else if (Delta ==0.0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = X1;
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
               txtF.setText(XF.toString() +"" +";"+YF.toString());
               txtV.setText(XF.toString()+""+";"+YV.toString());
               txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
               txtASimm.setText("X"+""+"="+XF.toString());
               txtConcavita.setText("Parabola con Concavita verso l'alto");
               Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
               Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
               txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
               txtintX1.setText(X1.toString()+""+";"+"0");
               txtintX2.setText(X2.toString()+""+";"+"0");
               txtintY.setText("0"+""+";"+""+C.toString());
               txtintD.setText("Parabola Seccante");
               }
               else if(Delta >0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = new Double((-B)-(Math.pow(Delta, 0.5)))/(2.0*A);
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
                txtF.setText(XF.toString() +"" +";"+YF.toString());
                txtV.setText(XF.toString()+""+";"+YV.toString());
                txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
                txtASimm.setText("X"+""+"="+XF.toString());
                txtConcavita.setText("Parabola con Concavita verso l'alto");
                Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
                Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
                txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
                txtintX1.setText(X1.toString()+""+";"+"0");
                txtintX2.setText(X2.toString()+""+";"+"0");
                txtintY.setText("0"+""+";"+""+C.toString());
                txtintD.setText("Parabola Tagente");
               }
           }else{
               Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
               if(Delta<0.0)
               {
                Double  X1=0.0;
                Double  X2=0.0;
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
                txtF.setText(XF.toString() +"" +";"+YF.toString());
                txtV.setText(XF.toString()+""+";"+YV.toString());
                txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
                txtASimm.setText("X"+""+"="+XF.toString());
                txtConcavita.setText("Parabola con Concavita verso il basso");
                Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
                Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
                txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
                txtintX1.setText(X1.toString()+""+";"+"0");
                txtintX2.setText(X2.toString()+""+";"+"0");
                txtintY.setText("0"+""+";"+""+C.toString());
                txtintD.setText("Parabola Esterna");
               }
               else if (Delta ==0.0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = X1;
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
               txtF.setText(XF.toString() +"" +";"+YF.toString());
               txtV.setText(XF.toString()+""+";"+YV.toString());
               txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
               txtASimm.setText("X"+""+"="+XF.toString());
               txtConcavita.setText("Parabola con Concavita verso il basso");
               Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
               Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
               txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
               txtintX1.setText(X1.toString()+""+";"+"0");
               txtintX2.setText(X2.toString()+""+";"+"0");
               txtintY.setText("0"+""+";"+""+C.toString());
               txtintD.setText("Parabola Seccante");
               }
               else if(Delta >0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = new Double((-B)-(Math.pow(Delta, 0.5)))/(2.0*A);
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
               txtF.setText(XF.toString() +"" +";"+YF.toString());
               txtV.setText(XF.toString()+""+";"+YV.toString());
               txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
               txtASimm.setText("X"+""+"="+XF.toString());
               txtConcavita.setText("Parabola con Concavita verso il basso");
               Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
               Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
               txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
               txtintX1.setText(X1.toString()+""+";"+"0");
               txtintX2.setText(X2.toString()+""+";"+"0");
               txtintY.setText("0"+""+";"+""+C.toString());
               txtintD.setText("Parabola Tagente");
               }
           }
           }else
           {
              txtA.setText("");
              txtB.setText("");
              txtC.setText("");
              txtD.setText("");
              txtintD.setText("");
              txtintX1.setText("");
              txtintX2.setText("");
              txtintY.setText("");
              txtV.setText("");
              txtF.setText("");
              txtP.setText("");
              txtASimm.setText("");
           }
        }

    txtA = textfield a per immetere il valore di a
    stessa cosa con b e c in quanto a e b sono i coeficenti di X^2 e X^1 e c il termine noto tutte e tre compogono l'equazione di secondo grado della parabola Y=AX^2+BX^1+C
    ^=elevato ad n,il mio programma prevente tutti numeri a,b,c,x1ex2,delta,ecc... apparneti all'insieme dei numeri razzionali.

  10. #10

    Re: Spiegazione

    Originariamente inviato da Cracker1992
    codice:
    l
    blDP.
    lblDP=la label che vorrei usare .= richiamo metodi (giusto?)
    dopo che metodo uso per il mio obbietivo descritto nei precendi messaggi
    e che parametri uso se devo usare parametri come faccio a indicare e usare una delle 6 parabole da paint in modo tale da rispetare gli if nei precendenti codici.
    come faccio?
    codice:
     
    
     private void ParabolaActionPerformed(java.awt.event.ActionEvent evt) { 
    
     Double A = new Double (txtA.getText());
           Double B = new Double (txtB.getText());
           Double C = new Double (txtC.getText());
           String AsseX = " Y =  0.0 " ;
           String AsseY = " X = 0.0 " ;
           String Origine = " 0.0 ; 0.0 ";
           if(A!=0.0){
             if(A>=0.0)
           {
               Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
               if(Delta<0.0)
               {
               Double X1 = 0.0;
               Double X2 = 0.0;
               Double YV = new Double(-(Delta)) / (4.0 * A);
               Double XF = new Double(-B) / (2.0 * A);
               Double YF = new Double(-(Delta) / (4.0 * A)) + (1.0 / (4.0 * A));
               txtF.setText(XF.toString() + "" + ";" + YF.toString());
               txtV.setText(XF.toString() + "" + ";" + YV.toString());
               txtD.setText("Y" + "" + "=" + XF.toString() + "" + "-" + YF.toString());
               txtASimm.setText("X" + "" + "=" + XF.toString());
               txtConcavita.setText("Parabola con Concavita verso l'alto");
               Double AX1 = new Double(A * (Math.pow(X1, 2.0)));
               Double BX2 = new Double(A * (Math.pow(X2, 1.0)));
               txtP.setText("Y" + "" + "=" + AX1.toString() + "" + "+" + BX2.toString() + "" + "+" + C.toString());
               txtintX1.setText(X1.toString() + "" + ";" + "0");
               txtintX2.setText(X2.toString() + "" + ";" + "0");
               txtintY.setText("0" + "" + ";" + "" + C.toString());
               txtintD.setText("Parabola Esterna");
               }
               else if (Delta ==0.0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = X1;
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
               txtF.setText(XF.toString() +"" +";"+YF.toString());
               txtV.setText(XF.toString()+""+";"+YV.toString());
               txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
               txtASimm.setText("X"+""+"="+XF.toString());
               txtConcavita.setText("Parabola con Concavita verso l'alto");
               Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
               Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
               txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
               txtintX1.setText(X1.toString()+""+";"+"0");
               txtintX2.setText(X2.toString()+""+";"+"0");
               txtintY.setText("0"+""+";"+""+C.toString());
               txtintD.setText("Parabola Seccante");
               }
               else if(Delta >0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = new Double((-B)-(Math.pow(Delta, 0.5)))/(2.0*A);
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
                txtF.setText(XF.toString() +"" +";"+YF.toString());
                txtV.setText(XF.toString()+""+";"+YV.toString());
                txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
                txtASimm.setText("X"+""+"="+XF.toString());
                txtConcavita.setText("Parabola con Concavita verso l'alto");
                Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
                Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
                txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
                txtintX1.setText(X1.toString()+""+";"+"0");
                txtintX2.setText(X2.toString()+""+";"+"0");
                txtintY.setText("0"+""+";"+""+C.toString());
                txtintD.setText("Parabola Tagente");
               }
           }else{
               Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
               if(Delta<0.0)
               {
                Double  X1=0.0;
                Double  X2=0.0;
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
                txtF.setText(XF.toString() +"" +";"+YF.toString());
                txtV.setText(XF.toString()+""+";"+YV.toString());
                txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
                txtASimm.setText("X"+""+"="+XF.toString());
                txtConcavita.setText("Parabola con Concavita verso il basso");
                Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
                Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
                txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
                txtintX1.setText(X1.toString()+""+";"+"0");
                txtintX2.setText(X2.toString()+""+";"+"0");
                txtintY.setText("0"+""+";"+""+C.toString());
                txtintD.setText("Parabola Esterna");
               }
               else if (Delta ==0.0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = X1;
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
               txtF.setText(XF.toString() +"" +";"+YF.toString());
               txtV.setText(XF.toString()+""+";"+YV.toString());
               txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
               txtASimm.setText("X"+""+"="+XF.toString());
               txtConcavita.setText("Parabola con Concavita verso il basso");
               Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
               Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
               txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
               txtintX1.setText(X1.toString()+""+";"+"0");
               txtintX2.setText(X2.toString()+""+";"+"0");
               txtintY.setText("0"+""+";"+""+C.toString());
               txtintD.setText("Parabola Seccante");
               }
               else if(Delta >0)
               {
                Double  X1 = new Double((-B)+(Math.pow(Delta, 0.5)))/(2.0*A);
                Double  X2 = new Double((-B)-(Math.pow(Delta, 0.5)))/(2.0*A);
                Double YV = new Double (-(Delta))/(4.0*A);
                Double XF = new Double(-B)/(2.0*A);
                Double YF = new Double (-(Delta)/(4.0*A))+(1.0/(4.0*A));
               txtF.setText(XF.toString() +"" +";"+YF.toString());
               txtV.setText(XF.toString()+""+";"+YV.toString());
               txtD.setText("Y" +""+"="+ XF.toString() + "" + "-"+ YF.toString());
               txtASimm.setText("X"+""+"="+XF.toString());
               txtConcavita.setText("Parabola con Concavita verso il basso");
               Double AX1 = new Double (A*(Math.pow(X1, 2.0)));
               Double BX2 = new Double (A*(Math.pow(X2, 1.0)));
               txtP.setText("Y"+""+"="+AX1.toString()+""+"+"+BX2.toString()+""+"+"+C.toString());
               txtintX1.setText(X1.toString()+""+";"+"0");
               txtintX2.setText(X2.toString()+""+";"+"0");
               txtintY.setText("0"+""+";"+""+C.toString());
               txtintD.setText("Parabola Tagente");
               }
           }
           }else
           {
              txtA.setText("");
              txtB.setText("");
              txtC.setText("");
              txtD.setText("");
              txtintD.setText("");
              txtintX1.setText("");
              txtintX2.setText("");
              txtintY.setText("");
              txtV.setText("");
              txtF.setText("");
              txtP.setText("");
              txtASimm.setText("");
           }
        }

    txtA = textfield a per immetere il valore di a
    stessa cosa con b e c in quanto a e b sono i coeficenti di X^2 e X^1 e c il termine noto tutte e tre compogono l'equazione di secondo grado della parabola Y=AX^2+BX^1+C
    ^=elevato ad n,il mio programma prevente tutti numeri a,b,c,x1ex2,delta,ecc... apparneti all'insieme dei numeri razzionali.
    in questo programma ogni txt rappresenta un texfield inserita in una maschera dove inserisco 3 dati di input il valore di a,b,c e poi un bottone Parabola che alla azione del mio click su esso mi fa apparire negli altri txt dei risultati dettati nelle istruzioni date da me per far in modo di vizualizare un po' di dati precisi per la costruzione della parabola ma io no vorrei limitare a solo risultati ma anche vorrei infine una label o qualcosa l'importante che mi appari in qualche modo al fondo un immagine assomigliate alla raperesentazione grafica di una parabola dati tutti parametri che le parabole hanno seguendo le regole matematiche di geometria alatica vorrei che il programmino o meglio il computer mi esegua tale disegno ma non cosa fare come si fa??????
    ogni di esso txt c'è un corrispodente lbl = label ettichetta per indicare di cosa parlo.
    txtD=Direttrice
    txtF=Fuoco
    txtV=Vertice
    txtintx1=intersezione con x1
    txtintx2 = con x2
    intY = intersezione con y
    txtP = equazione parabola P=PARABOLA
    txtASimm = Asse Simmetria
    txtConcavità = concavita che serverve emmetere una stringa di testo in ouput per in idicare se la concavita della parabola è verso l'alto o il basso a seconda dei casi.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.