answersLogoWhite

0


Best Answer

What do you mean by "compute"? Do you want to graph it? Factor it? Calculate it's function given a set of points that lie on it?

If you're looking to compute the function given three points that fall on the parabola, then I have just the code for you. If you're given three points, (x1, y1), (x2, y2) and (x3, y3), then you can compute the coefficients of your quadratic equation like this:

a = (y1 * (x2 - x3) + y2 * (x3 - x1) + y3 * (x1 - x2)) / (x1 * x1 * (x2 - x3) + x2 * x2 * (x3 - x1) + x3 * x3 * (x1 - x2))

b = (y1 - y2) / (x1 - x2) - a * (x1 + x2);

c = y1 - (x1 * x1) * a - x1 * b;

You now can calculate the y co-ordinate of any point given it's x co-ordinate by saying:

y = a * x * x + b * x + c;

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you compute quadratic equation using java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

Write a java program to find the value of quadratic equation 3x-8x plus 4 for several values of x?

public class QuadraticEquation { publicstatic void main(String args[]){ for(int x =0 ; x


What is the difference between advanced java J2EE?

J2EE stands for Java 2 Enterprise Edition. It is used to create enterprise class web applications that can be used by large enterprises and corporations. Most websites of major companies are created using j2ee. Some of the technologies used in J2ee are: a. Struts b. Hibernate c. JSP d. Servlets e. Spring f. etc Whereas Advanced Java refers to the advanced topics of java that can be used in regular java programs. Some topics under Advanced Java are: a. Exception Handling b. Threading/Multi-Threading c. Remote Method Invocation d. Serialization e. etc


What is the Java integer class used for?

The Java Integer class is there to help with math. It is very useful and very recommended. To learn more information about it, go to the official Java page.


How to write a java program that determines the number of prime numbers less than N which is given by the user?

where to start? do you have an algorithm and just want to implement it in java? depends on how big N is, as that will determine which method is most efficient


Which is not a stand alone program a. Java b. Javascript c. Both a and b d. None of the above?

If you are talking about programs written in those languages: Both. Java relies on the JVM and Javascript relies on your web browser. Otherwise: Neither

Related questions

How do you compute the product of integers 1 to 10 in JAVA?

There are, of course, several ways to do this, but the simplest way is probably using a "for" loop: int product = 1; for(int i = 1; i<= 10; i++) product *= i;


What is a factorial loop?

An example in Java, to compute 10!: int factorial = 1; for(int i = 1; i < 11; i++) { factorial *= i; }


How do you control PowerPoint slides using java?

You can control Powerpoint Slides using Java with Aspose.Slides for Java Library: - http://www.aspose.com/java/powerpoint-component.aspx


What are the technologies without using java?

you can use type writer to avoid using java :)


Write a java that computes the value of 2?

Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);


What are java applications?

Applications that are built using the Java language are termed as Java applications.


What is the areas of application of java?

Applications that are built using the Java language are termed as Java applications.


Has anyone developed web services using java?

of course, there are services developed using java technology


How do you execute a Java program?

You can run a Java application from the command line using "java <name of the class>"


Is it possible to draw in java without using applet?

Yes it is possible to draw in java by using AWT package. or by using javax package.


What has the author Joe Weber written?

Joe Weber has written: 'Using Java 1.2' -- subject(s): Java (Computer program language) 'Using Java 1.1' -- subject(s): Java (Computer program language)


Can you provide a solution to the diamond-square algorithm using Java and recursion?

Yes. It is possible to provide a solution to the diamond-square algorithm using Java and recursion.