|
@@ -71,6 +71,7 @@ class GeneralFormulas {
|
|
|
|
|
|
static double medianVelocity(double ps, double ed) =>
|
|
static double medianVelocity(double ps, double ed) =>
|
|
_singleton.medianVelocity(ps, ed);
|
|
_singleton.medianVelocity(ps, ed);
|
|
|
|
+ static double volume(double d) => _singleton.volume(d);
|
|
}
|
|
}
|
|
|
|
|
|
abstract class IGeneralFormulaStrategy {
|
|
abstract class IGeneralFormulaStrategy {
|
|
@@ -102,6 +103,7 @@ abstract class IGeneralFormulaStrategy {
|
|
double area(double d1, double d2);
|
|
double area(double d1, double d2);
|
|
double flowVolTAMAX(double flowArea, double tamean, double coefficient);
|
|
double flowVolTAMAX(double flowArea, double tamean, double coefficient);
|
|
double perimeter(double d1, double d2);
|
|
double perimeter(double d1, double d2);
|
|
|
|
+ double volume(double d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -508,6 +510,15 @@ class BaseGeneralFormulas implements IGeneralFormulaStrategy {
|
|
double h = math.pow((k - 1), 2) / math.pow((k + 1), 2);
|
|
double h = math.pow((k - 1), 2) / math.pow((k + 1), 2);
|
|
return math.pi * (1 + 3 * h / (10 + math.sqrt(4 - 3 * h)));
|
|
return math.pi * (1 + 3 * h / (10 + math.sqrt(4 - 3 * h)));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @override
|
|
|
|
+ double volume(double d) {
|
|
|
|
+ double volume = 0.0;
|
|
|
|
+ if (!almostEquals(d, 0.0)) {
|
|
|
|
+ volume = math.pow(d, 3) * math.pi / 6.0;
|
|
|
|
+ }
|
|
|
|
+ return volume;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class AnimalsGeneralFormulas extends BaseGeneralFormulas {}
|
|
class AnimalsGeneralFormulas extends BaseGeneralFormulas {}
|