Forum by laureateci.it
[ Home | REGOLE FORUM | Tutti i blog | Profilo | Registrati | CHAT | Discussioni Attive | Discussioni Recenti | Segnalibro | Msg privati | Sondaggi Attivi | Utenti | Download Informatica | Download ICD | Download TPS | Download Magistrale | Download Specialistica | Giochi | Cerca nel web | cerca | faq | RSS ]
Nome Utente:
Password:
Salva Password
Password Dimenticata?

 Tutti i Forum
 Cultura Informatica
 Corso di java
 Disegnare una Parabola{Problema}[Java](Programma)

Nota: Devi essere registrato per poter inserire un messaggio.
Per registrarti, clicca qui. La Registrazione è semplice e gratuita!

Larghezza finestra:
Nome Utente:
Password:
Modo:
Formato: GrassettoCorsivoSottolineatoBarrato Aggiungi Spoiler Allinea a  SinistraCentraAllinea a Destra Riga Orizzontale Inserisci linkInserisci EmailInserisci FlashInserisci Immagine Inserisci CodiceInserisci CitazioneInserisci Lista Inserisci Faccine
   
Icona Messaggio:              
             
Messaggio:

  * Il codice HTML è OFF
* Il Codice Forum è ON

Smilies
Approvazione [^] Arrabbiato [:(!] Bacio [:X] Bevuta [:273]
Caldo [8D] Compiaciuto [8)]    
compleanno [:269]
Davvero Felice [:D] Diavoletto [}:)] Disapprovazione [V] Domanda [?]
Felice [:)] Fumata [:29] Goloso [:P] Imbarazzato [:I]
Infelice [:(] Morte improvvisa da [:62]
Morto [xx(] Occhio Nero [B)] Occhiolino [;)] Palla 8 [8]
pc [:205]    
Riproduzione [:76]
Scioccato [:O]      

   Allega file
  Clicca qui per inserire la tua firma nel messaggio.
Clicca qui per sottoscrivere questa Discussione.
    

V I S U A L I Z Z A    D I S C U S S I O N E
Cracker1992 Inserito il - 10/09/2010 : 19:01:38

Ciao a tutti! ho un problema nel scrivere un programma in Java, usando come abiente NetBeans versione 6.9.ho bisogno di un codice per completare,come risolvo? il problema è appunto creare in una label o in altro non so cosa ci vuole, un disegno di una parabola magari inserendo dei colori personalizzabili, il codice vorrei che previsse l'evento del click sul jbutton e nel eseguire i calcoli alla fine uscisse la parabola che corrisponde alla rappresentazione grafica dei risultati numerici del mia jdesktopapplication. oppure come faccio a caricare immagini jpg dal mio computer alla mia label. che se il primo tipo di disegno non si puo fare posso optare nel creare delle parabole in paint e salvarle in jpg o nei formati supportati.
in ogni caso come posso disegnare la parabola del campo di matematica (la geometria analitica) quindi anche il piano cartesiano deve essere presente nel disegno. comunque deve rappresentare l'equazione y=ax^2+bx+c e la definizione di parabola.infatti nella prima optzione ci devono essere presenti anche questi elementi:
1) direttrice
2) l'asse della parabola di simmetria
3) fuoco
4) vertice
5) se ci sono le intersezioni con gli assi cartesiani
6) se ci sono le intersezioni con la direttrice.
una cosa figa sarebbe che uscisse un disegno tipo questo:
direttrice e asse parabola in blu e linee trattegiate, parabola a puntini in rosso, vertice,fuoco,intersezioni varie in verde, assi cartesiani e origine in nero gli assi non trattegiati appunto per distiguere l'asse della parabola e direttrice dagli assi cartesiani.
per ora ho prodotto questo codice:




JOptionPane.showMessageDialog(null,"Creato da Cracker1992");
if(cbn.getSelectedIndex()==0.0){
try{
Double A = new Double(txtA.getText());
Double B = new Double(txtB.getText());
Double C= new  Double(txtC.getText());
}catch(NumberFormatException exception ){
JOptionPane.showMessageDialog(null,"inserisci solo valori numerici in a,b, e c");
txtA.setText("");
txtB.setText("");
txtC.setText("");
txtA.grabFocus();
txtB.grabFocus();
txtC.grabFocus();
}
Double A = new Double(txtA.getText());
Double B = new Double(txtB.getText());
Double C= new  Double(txtC.getText());
txtA1.setText("");
txtA2.setText("");
txtB1.setText("");
txtB2.setText("");
txtC1.setText("");
txtC2.setText("");
txtA1.grabFocus();
txtA2.grabFocus();
txtB1.grabFocus();
txtB2.grabFocus();
txtC1.grabFocus();
txtC2.grabFocus();
if(txtA.getText().equals("")&& txtB.getText().equals("") && txtC.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in a,b e c");
        }else if(txtA.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valore richiesto in a");
        } else if(txtB.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valore richiesto in b");
        } else if(txtC.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valore richiesto in b");
        }else if( txtA.getText().equals("") || txtC.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valori mancanti soprattutto in a");
        } else if( txtA.getText().equals("") || txtB.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valori mancanti soprattutto in a");
        }else if( txtB.getText().equals("") || txtC.getText().equals("")){
           JOptionPane.showMessageDialog(null,"inserisci il valori mancanti ....");
        } else if( txtA.getText().equals("") && txtC.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valori mancanti in a e c");
        } else if( txtA.getText().equals("") && txtB.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valori mancanti in a e b");
        }else if( txtB.getText().equals("") && txtC.getText().equals("")){
            JOptionPane.showMessageDialog(null,"inserisci il valori mancanti in b e c");
        }else{
JOptionPane.showMessageDialog(null,"bene hai inserito i valori richiesti");
if( A!=0.0){
if(A>=0.0){
Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
Double k = new Double(Math.floor(Delta));
if(k<0.0){
JOptionPane.showMessageDialog(null,"il delta è minore  di 0 quindi nessuna soluzione reale");
Double YV = new Double (-(k)) / (4.0 * A);
                        Double XF = new Double (-B) / (2.0 * A);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * A)) + (1.0 / (4.0 * A));
                        Double D = new  Double (-(k) / (4.0 * A)) - (1.0 / (4.0 * A));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso l'alto");
                        txtintX1.setText("");
                        txtintX2.setText("");
                 if(B>0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B<0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B>0.0 && C<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString())+ "" + "X"+ String.format(C.toString()));
                        }else if (B<0 && C<0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+String.format(C.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(C.toString()));
                        txtintD.setText("Parabola Esterna");

}else if (k==0.0){
JOptionPane.showMessageDialog(null,"il delta è uguale a 0 quindi due soluzioni reali e coicidenti");
Double YV = new Double (-(k)) / (4.0 * A);
                        Double XF = new Double (-B) / (2.0 * A);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * A)) + (1.0 / (4.0 * A));
                        Double D = new  Double (-(k) / (4.0 * A)) - (1.0 / (4.0 * A));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        Double X1= new Double(Math.pow(k,0.5)+(-B))/(2.0*A);
                        Double X2=X1;
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso l'alto");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                      if(B>0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B<0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B>0.0 && C<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString())+ "" + "X"+ String.format(C.toString()));
                        }else if (B<0 && C<0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+String.format(C.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(C.toString()));
                        txtintD.setText("Parabola Tagente");
}else if(k>0.0){
JOptionPane.showMessageDialog(null,"il delta è maggiore a 0 quindi due soluzioni reali non  coicidenti");
Double  X1 = new Double((-B)+(Math.pow(k, 0.5)))/(2.0*A);
                        Double  X2 = new Double((-B)-(Math.pow(k, 0.5)))/(2.0*A);
                        Double YV = new Double (-(k)) / (4.0 * A);
                        Double XF = new Double (-B) / (2.0 * A);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * A)) + (1.0 / (4.0 * A));
                        Double D = new  Double (-(k) / (4.0 * A)) - (1.0 / (4.0 * A));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso l'alto");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                      if(B>0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B<0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B>0.0 && C<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString())+ "" + "X"+ String.format(C.toString()));
                        }else if (B<0 && C<0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+String.format(C.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(C.toString()));
                        txtintD.setText("Parabola Seccante");

}
}else{
Double Delta = new Double (Math.pow(B, 2.0))-(4.0*(A)*(C));
Double k = new Double(Math.floor(Delta));
if(k<0.0){
JOptionPane.showMessageDialog(null,"il delta è minore  di 0 quindi nessuna soluzione reale");
Double YV = new Double (-(k)) / (4.0 * A);
                        Double XF = new Double (-B) / (2.0 * A);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * A)) + (1.0 / (4.0 * A));
                        Double D = new  Double (-(k) / (4.0 * A)) - (1.0 / (4.0 * A));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso il basso");
                        txtintX1.setText("");
                        txtintX2.setText("");
                           if(B>0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B<0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B>0.0 && C<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString())+ "" + "X"+ String.format(C.toString()));
                        }else if (B<0 && C<0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+String.format(C.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(C.toString()));
                        txtintD.setText("Parabola Esterna");
}else if (k==0.0){
JOptionPane.showMessageDialog(null,"il delta è uguale a 0 quindi due soluzioni reali e coicidenti");
Double YV = new Double (-(k)) / (4.0 * A);
                        Double XF = new Double (-B) / (2.0 * A);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * A)) + (1.0 / (4.0 * A));
                        Double D = new  Double (-(k) / (4.0 * A)) - (1.0 / (4.0 * A));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        Double X1= new Double(Math.pow(k,0.5)+(-B))/(2.0*A);
                        Double X2=X1;
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso il basso");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                      if(B>0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B<0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B>0.0 && C<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString())+ "" + "X"+ String.format(C.toString()));
                        }else if (B<0 && C<0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+String.format(C.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(C.toString()));
                        txtintD.setText("Parabola Tagente");
}else if(k>0.0){
JOptionPane.showMessageDialog(null,"il delta è maggiore a 0 quindi due soluzioni reali non  coicidenti");
Double  X1 = new Double((-B)+(Math.pow(k, 0.5)))/(2.0*A);
                        Double  X2 = new Double((-B)-(Math.pow(k, 0.5)))/(2.0*A);
                        Double YV = new Double (-(k)) / (4.0 * A);
                        Double XF = new Double (-B) / (2.0 * A);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * A)) + (1.0 / (4.0 * A));
                        Double D = new  Double (-(k) / (4.0 * A)) - (1.0 / (4.0 * A));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso il basso");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                      if(B>0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B<0.0 && C>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
String.format(B.toString()) + "" + "X"+"+"+ String.format(C.toString()));
                        }else if(B>0.0 && C<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+
"+"+  String.format(B.toString())+ "" + "X"+ String.format(C.toString()));
                        }else if (B<0 && C<0){
                        txtP.setText("Y" + "" + "=" + String.format(A.toString()) + "" +"X^2"+String.format(C.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(C.toString()));
                        txtintD.setText("Parabola Seccante");
}
}   
}else{
JOptionPane.showMessageDialog (null,"inserisci valori diversi da zero in a ");
                txtA.grabFocus();
                txtA.setText("");    
}
}
}else{
try{
Double A1 = new Double(txtA1.getText());
Double B1 = new Double(txtB1.getText());
Double C1 = new Double(txtC1.getText());
Double A2 = new Double(txtA2.getText());
Double B2 = new Double(txtB2.getText());
Double C2 = new Double(txtC2.getText());
}catch(NumberFormatException exception ){
JOptionPane.showMessageDialog(null,"inserisci solo valori numerici in a1,a2, b1,b2,c1 e c2");
txtA1.setText("");
txtA2.setText("");
txtB1.setText("");
txtB2.setText("");
txtC1.setText("");
txtC2.setText("");
txtA1.grabFocus();
txtA2.grabFocus();
txtB1.grabFocus();
txtB2.grabFocus();
txtC1.grabFocus();
txtC2.grabFocus();
}
Double A1 = new Double(txtA1.getText());
Double B1 = new Double(txtB1.getText());
Double C1 = new Double(txtC1.getText());
Double A2 = new Double(txtA2.getText());
Double B2 = new Double(txtB2.getText());
Double C2 = new Double(txtC2.getText());
txtA.setText("");
txtB.setText("");
txtC.setText("");
txtA.grabFocus();
txtB.grabFocus();
txtC.grabFocus();
if(txtA1.getText().equals("")&& txtA2.getText().equals("") && txtB1.getText().equals("")&& txtB2.getText().equals("") && txtC1.getText().equals("")&& txtC2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti");
if(txtA1.getText().equals("")&& txtA2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in a1 e a2");
if(txtA1.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in a1 ");
}else if(txtA2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in a2 ");
}else if(txtA1.getText().equals("")||txtA2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori mancanti ");
}
}else if(txtB1.getText().equals("")&& txtB2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in b1 e b2");
if(txtB1.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in b1 ");
}else if(txtB2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in b2 ");
}else if(txtB1.getText().equals("")||txtB2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori mancanti ");
}
}
else if(txtC1.getText().equals("")&& txtC2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in c1 e c2");
if(txtC1.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in c1 ");
}else if(txtC2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori richiesti in c2 ");
}else if(txtC1.getText().equals("")||txtC2.getText().equals("")){
JOptionPane.showMessageDialog(null,"inserisci i valori mancanti ");
}
}
}else{
JOptionPane.showMessageDialog(null,"bene hai inserito i valori richiesti");
if((A1!=0.0) && (B1!=0.0) && (C1!=0.0) && (A2!=0.0) && (B2!=0.0) && (C2!=0.0)){
Double coefA = new Double(A1/A2);
Double coefB = new Double(B1/B2);
Double coefC = new Double(C1/C2);
Double x = new Double(Math.ceil(coefA));
Double y = new Double(Math.round(coefB));
Double z = new Double(Math.floor(coefC));
if(x==0.0){
JOptionPane.showMessageDialog(null,"nessuna parabola ");
txtF.setText("");
txtV.setText("");
txtD.setText("");
txtintX1.setText("");
txtintX2.setText("");
txtP.setText("");
txtintD.setText("");
txtintY.setText("");
txtConcavita.setText("");
txtASimm.setText("");
txtA1.setText("");
txtA2.setText("");
txtB1.setText("");
txtB2.setText("");
txtC1.setText("");
txtC2.setText("");
txtA1.grabFocus();
txtA2.grabFocus();
txtB1.grabFocus();
txtB2.grabFocus();
txtC1.grabFocus();
txtC2.grabFocus();
}else {
if(x>0.0){
Double Delta = new Double(Math.pow( y,2.0)-(4.0*(x)*(z)));
Double k = new Double(Math.floor(Delta));
if(k<0.0){
JOptionPane.showMessageDialog(null,"il delta è minore  di 0 quindi nessuna soluzione reale");
Double YV = new Double (-(k)) / (4.0 * x);
                        Double XF = new Double (-y) / (2.0 *x);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * x)) + (1.0 / (4.0 * x));
                        Double D = new  Double (-(k) / (4.0 * x)) - (1.0 / (4.0 * x));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso l'alto");
                        txtintX1.setText("");
                        txtintX2.setText("");
                        if(y>0.0 && z>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(y<0.0 && z>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(y>0.0 && z<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString())+ "" + "X"+ String.format(z.toString()));
                        }else if (y<0 && z<0){
                        txtP.setText("Y" + "" + "=" + String.format(z.toString()) + "" +"X^2"+String.format(z.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(z.toString()));
                        txtintD.setText("Parabola Esterna");
}else if(k==0.0){
JOptionPane.showMessageDialog(null,"il delta è uguale a 0 quindi due soluzioni reali e coicidenti");
Double  X1 = new Double ((-y)+(Math.pow(k, 0.5)))/(2.0*x);
                        Double  X2 = X1;
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        Double YV = new Double (-(k)) / (4.0 * x);
                        Double XF = new Double (-y) / (2.0 *x);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * x)) + (1.0 / (4.0 * x));
                        Double D = new  Double (-(k) / (4.0 * x)) - (1.0 / (4.0 * x));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso l'alto");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                        if(coefB>0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB<0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB >0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString())+ "" + "X"+ String.format(z.toString()));
                        }else if (coefB<0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"
+String.format(z.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(z.toString()));
                        txtintD.setText("Parabola Tagente");
}else if(k>0.0){
JOptionPane.showMessageDialog(null,"il delta è maggiore a 0 quindi due soluzioni reali non  coicidenti");
Double  X1 = new Double ((-y)+(Math.pow(k, 0.5)))/(2.0*x);
                        Double  X2 =((-y)-(Math.pow(k, 0.5)))/(2.0*x);
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        Double YV = new Double (-(k)) / (4.0 * x);
                        Double XF = new Double (-y) / (2.0 *x);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * x)) + (1.0 / (4.0 * x));
                        Double D = new  Double (-(k) / (4.0 * x)) - (1.0 / (4.0 * x));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso l'alto");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                        if(coefB>0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB<0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB >0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString())+ "" + "X"+ String.format(z.toString()));
                        }else if (coefB<0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"
+String.format(z.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(z.toString()));
                        txtintD.setText("Parabola Seccante");
}
}else{
Double Delta = new Double(Math.pow( y,2.0)-(4.0*(x)*(z)));
Double k = new Double(Math.floor(Delta));
if(k<0){
JOptionPane.showMessageDialog(null,"il delta è minore  di 0 quindi nessuna soluzione reale");
Double YV = new Double (-(k)) / (4.0 * x);
                        Double XF = new Double (-y) / (2.0 *x);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * x)) + (1.0 / (4.0 * x));
                        Double D = new  Double (-(k) / (4.0 * x)) - (1.0 / (4.0 * x));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso il basso");
                        txtintX1.setText("");
                        txtintX2.setText("");
                           if(y>0.0 && z>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(y<0.0 && z>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(y>0.0 && z<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString())+ "" + "X"+ String.format(z.toString()));
                        }else if (y<0 && z<0){
                        txtP.setText("Y" + "" + "=" + String.format(z.toString()) + "" +"X^2"+String.format(z.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(z.toString()));
                        txtintD.setText("Parabola Esterna");
}
else if(k==0.0){
JOptionPane.showMessageDialog(null,"il delta è uguale a 0 quindi due soluzioni reali e coicidenti");
Double  X1 = new Double ((-y)+(Math.pow(k, 0.5)))/(2.0*x);
                        Double  X2 = X1;
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        Double YV = new Double (-(k)) / (4.0 * x);
                        Double XF = new Double (-y) / (2.0 *x);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * x)) + (1.0 / (4.0 * x));
                        Double D = new  Double (-(k) / (4.0 * x)) - (1.0 / (4.0 * x));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso il basso");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                        if(coefB>0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB<0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB >0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString())+ "" + "X"+ String.format(z.toString()));
                        }else if (coefB<0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"
+String.format(z.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(z.toString()));
                        txtintD.setText("Parabola Tagente");
}
else if(k>0.0){
JOptionPane.showMessageDialog(null,"il delta è maggiore a 0 quindi due soluzioni reali non  coicidenti");
Double  X1 = new Double ((-y)+(Math.pow(k, 0.5)))/(2.0*x);
                        Double  X2 =((-y)-(Math.pow(k, 0.5)))/(2.0*x);
                        Double  s = new Double (Math.round(X1));
                        Double  t = new Double (Math.round(X2));
                        Double YV = new Double (-(k)) / (4.0 * x);
                        Double XF = new Double (-y) / (2.0 *x);
                        Double XV = XF;
                        Double YF = new Double (-(k) / (4.0 * x)) + (1.0 / (4.0 * x));
                        Double D = new  Double (-(k) / (4.0 * x)) - (1.0 / (4.0 * x));
                        Double q,r,u,p,w;
                        q= Math.floor(YV);
                        r= Math.floor(YF);
                        u= Math.floor(XV);
                        p= Math.floor(D);
                        w= Math.floor(XF);
                        if(w==0.0 && r==0.0){
                        Double num = Math.abs(w);
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(num.toString())+ "" + ";" + String.format(num1.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(w==0.0 && r!=0.0){
                        Double num = Math.abs(w);
                        txtF.setText(String.format(num.toString()+ "" + ";" + String.format(r.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(num.toString()));
                        }else if(r==0.0 && w!=0) {
                        Double num1 = Math.abs(r);
                        txtF.setText(String.format(w.toString()+ "" + ";" + String.format(num1.toString())));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString()));
                        }else if(w!=0.0 && r!=0.0){
                        txtF.setText(String.format(r.toString())+ "" + ";" + String.format(w.toString()));
                        txtASimm.setText("X" + "" + "=" + String.format(w.toString())) ;
                        }
                        if(u==0.0 && q==0){
                        Double num = Math.abs(u);
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(num.toString() + "" + ";" + String.format(num1.toString())));
                        }else if (u==0.0 && q!=0.0){
                        Double num1 = Math.abs(u);
                        txtV.setText(String.format(num1.toString() + "" + ";" + String.format(q.toString())));
                        }else if(u!=0.0 && q!=0.0){
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(q.toString())));
                        }else if(q==0.0 && u!=0){
                        Double num1 = Math.abs(q);
                        txtV.setText(String.format(u.toString() + "" + ";" + String.format(num1.toString())));
                        }
                        if(p==0.0){
                        Double num1 = Math.abs(p);
                        txtD.setText("Y" + "" + "="+ String.format(num1.toString()));
                        }else{
                        txtD.setText("Y" + "" + "="+ String.format(p.toString()));
                        }
                        txtConcavita.setText("Parabola con Concavita verso il basso");
                        txtintX1.setText(String.format(s.toString())+""+";"+ "" +"0.0");
                        txtintX2.setText(String.format(t.toString())+""+";"+ "" +"0.0");
                        if(coefB>0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB<0.0 && coefC>0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
String.format(y.toString()) + "" + "X"+"+"+ String.format(z.toString()));
                        }else if(coefB >0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"+
"+"+  String.format(y.toString())+ "" + "X"+ String.format(z.toString()));
                        }else if (coefB<0.0 && coefC<0.0){
                        txtP.setText("Y" + "" + "=" + String.format(x.toString()) + "" +"X^2"
+String.format(z.toString()));
                        }
                        txtintY.setText("0.0" + "" + ";" + "" + String.format(z.toString()));
                        txtintD.setText("Parabola Seccante");
}
}
}
}else{
JOptionPane.showMessageDialog(null,"inserici in a1,b1,c1,c2,b2 e a2 valori diveri da zero");
txtA1.setText("");
txtB1.setText("");
txtC1.setText("");
txtA2.setText("");
txtB2.setText("");
txtC2.setText("");
txtA1.grabFocus();
txtB1.grabFocus();
txtC1.grabFocus();
txtA2.grabFocus();
txtB2.grabFocus();
txtC2.grabFocus();
}
}
}
}  


Immagine:

4,46 KB

se ho sbagliato sezione mi scuso e spero che lo staff per causa mia sposta questa discussione.
2   U L T I M E    R I S P O S T E    (in alto le più recenti)
Cracker1992 Inserito il - 24/09/2010 : 19:08:58
ciao a tutti!ho bisogno di capire una delle due cose che adro illustrae e poi ho trovato la soluzione dei problemi, quindi se mi date una spiegazione sareste di grande aiuto.
in pratica ho scoperto due metodi per disegnare parabole solo che non capito il funzionamento e come posso usarli in modo da dare come dei parametri i risultati di calcolati scrivento dentro le paratesi tonde i nomi delle variabili con i calcoli.

il primo metodo è:

codice:
drawArc(int x,inty,int largezza,int altezza,int angoloIniziale,int angoloArco);



il secondo metodo sarebbe usare la sottoclasse QuadCurve2D di Shape importando
codice:
java.awt.geom.*;



solo che non so come uttilizarla in modo tale che creo una parabola dentro una label uttilizando i suoi metodi e poi come posso selezionare le parti da disegnare in modo tale che posso cambiarci ad esempio il colore il tratto.
dentro la label deve comparire una parabola dentro il piano cartesiano.
il mio progetto di disegno è questo cosi mi dite come farlo diretto come vorrrei io.
piano cartesiano in nero con tratto continuo, parabola in blu a puntini, asse di simmetria e direttrice a tratto trattegiato in rosso, i punti d'intersezione direttrice e parabola, assi e parabola,l'origine,il fuoco e il vertice in verde pallino pieno.
Cracker1992 Inserito il - 11/09/2010 : 09:44:56

per lo meno inviatemi una risposta su qualche consiglio grafico nel caso il problema si puo risolvere magari i colori che mettereste voi in quanto ho detto dei colori a caso.o se ci sono altre opzioni oltre a quelle indicate da me per creare una parabola anche se non rispecchia perfertamente le soluzioni algebriche mi basta che si veda a seconda dei casi se è in basso o in alto e se interseca con la direttrice.

Forum by laureateci.it © 2002 - 2012 Laureateci Communications Torna all'inizio della Pagina
Il DB ha risposto in 0,66 secondi.

TargatoNA.it | SuperDeejay.Net | Antidoto.org | Brutto.it | Equiweb.it | Snitz Forum 2000