|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectNumbers.QuadraticEquation
public class QuadraticEquation
Calculates solutions to the quadratic equation. Also calculates whether there are real solutions or not.
| Field Summary | |
|---|---|
private double |
a
first variable in equation |
private double |
b
second variable in equation |
private double |
c
third variable in equation |
private double |
x
used to return first solution |
private double |
y
used to return second solution |
| Constructor Summary | |
|---|---|
QuadraticEquation(double a,
double b,
double c)
Constructs a new QuadraticEquation problem. |
|
| Method Summary | |
|---|---|
double |
getSolution1()
Calculates and returns the first solution to the problem. |
double |
getSolution2()
Calculates and returns the second solution to the problem. |
(package private) boolean |
hasSolutions()
Determines whether the problem has any real solutions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private double a
private double b
private double c
private double x
private double y
| Constructor Detail |
|---|
public QuadraticEquation(double a,
double b,
double c)
a - - first variable in quadratic equation (ax squared + bx + c)b - - second variable in quadratic equationc - - third variable in quadratic equation| Method Detail |
|---|
public double getSolution1()
public double getSolution2()
boolean hasSolutions()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||