cylinderCartesian static method
Returns a three dimensional SearchSpace with a
cylindrical geometry defined in terms of
Cartesian coordiantes [x, y, z]
.
Implementation
static SearchSpace cylinderCartesian({
num rho = 1,
num zMin = 0,
num zMax = 1,
List<num> centre = const <double>[0.0, 0.0, 0, 0],
}) {
// Define intervals.
final x0 = centre[0];
final y0 = centre[1];
final z0 = centre[2];
final x = FixedInterval(
x0 - rho,
x0 + rho,
name: 'x',
);
final r2 = rho * rho;
final y = ParametricInterval(
() => y0 - sqrt(r2 - pow(x.next() - x0, 2)),
() => y0 + sqrt(r2 - pow(x.next() - x0, 2)),
name: 'y',
);
final z = FixedInterval(z0 + zMin, z0 + zMax, name: 'z');
return SearchSpace.parametric([x, y, z], name: 'cylinder xyz');
}