![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.svek.image.QuadraticEquation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.svek.image;
public class QuadraticEquation {
private final double a;
private final double b;
private final double c;
public QuadraticEquation(double a, double b, double c) {
this.a = a;
this.b = b;
this.c = c;
}
public double[] solve() {
final double delta = b * b - 4 * a * c;
final double x0 = (-b - Math.sqrt(delta)) / 2 / a;
final double x1 = (-b + Math.sqrt(delta)) / 2 / a;
return new double[] { x0, x1 };
}
public double getV(double x) {
return a * x * x + b * x + c;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy