* have to be moved at index {@code dstIndex}.
*/
setZero();
for (int dstIndex=0; dstIndex<dstAxis.length; dstIndex++) {
boolean hasFound = false;
final AxisDirection dstAxe = dstAxis[dstIndex];
final AxisDirection search = dstAxe.absolute();
for (int srcIndex=0; srcIndex<srcAxis.length; srcIndex++) {
final AxisDirection srcAxe = srcAxis[srcIndex];
if (search.equals(srcAxe.absolute())) {
if (hasFound) {
// TODO: Use the localized version of 'getName' in GeoAPI 2.1
throw new IllegalArgumentException(Errors.format(ErrorKeys.COLINEAR_AXIS_$2,
srcAxe.name(), dstAxe.name()));
}
hasFound = true;
/*
* Set the matrix elements. Some matrix elements will never
* be set. They will be left to zero, which is their wanted
* value.
*/
final boolean normal = srcAxe.equals(dstAxe);
double scale = (normal) ? +1 : -1;
double translate = 0;
if (validRegions) {
translate = (normal) ? dstRegion.getMinimum(dstIndex)
: dstRegion.getMaximum(dstIndex);