@Override public void apply(final RealLocalizable source, final RealPositionable target) { assert source.numDimensions() >= numDimensions() && target.numDimensions() >= numDimensions() : "Input dimensions too small."; target.setPosition(source.getDoublePosition(0) * s[0], 0); target.setPosition(source.getDoublePosition(1) * s[1], 1); target.setPosition(source.getDoublePosition(2) * s[2], 2); }
@Override public void apply(final RealLocalizable source, final RealPositionable target) { assert source.numDimensions() >= 2 && target.numDimensions() >= 2 : "2d affine transformations can be applied to 2d coordinates only."; target.setPosition( source.getDoublePosition(0) * a.m00 + source.getDoublePosition(1) * a.m01 + a.m02, 0); target.setPosition( source.getDoublePosition(0) * a.m10 + source.getDoublePosition(1) * a.m11 + a.m12, 1); }
@Override public void realMax(final RealPositionable max) { for (int d = 0; d < max.numDimensions(); d++) { max.setPosition(position[d] + radius, d); } }
@Override public void realMin(final RealPositionable min) { for (int d = 0; d < min.numDimensions(); d++) { min.setPosition(position[d] - radius, d); } }
@Override public void realMax(RealPositionable max) { for (int i = 0; i < dims.length; ++i) { max.setPosition(dims[i] - 1, i); } }
@Override public void realMin(RealPositionable min) { for (int i = 0; i < dims.length; ++i) { min.setPosition(0, i); } }