Add transformations
505090
function(o, relative) {
    // get target in case of the fx module, otherwise reference this
    var target = this
      , matrix

    // act as a getter
    if (typeof o !== 'object') {
      // get current matrix
      matrix = new SVG.Matrix(target).extract()

      return typeof o === 'string' ? matrix[o] : matrix
    }

    // get current matrix
    matrix = new SVG.Matrix(target)

    // ensure relative flag
    relative = !!relative || !!o.relative

    // act on matrix
    if (o.a != null) {
      matrix = relative ?
        // relative
        matrix.multiply(new SVG.Matrix(o)) :
        // absolute
        new SVG.Matrix(o)

    // act on rotation
    } else if (o.rotation != null) {
      // ensure centre point
      ensureCentre(o, target)

      // apply transformation
      matrix = relative ?
        // relative
        matrix.rotate(o.rotation, o.cx, o.cy) :
        // absolute
        matrix.rotate(o.rotation - matrix.extract().rotation, o.cx, o.cy)

    // act on scale
    } else if (o.scale != null || o.scaleX != null || o.scaleY != null) {
      // ensure centre point
      ensureCentre(o, target)

      // ensure scale values on both axes
      o.scaleX = o.scale != null ? o.scale : o.scaleX != null ? o.scaleX : 1
      o.scaleY = o.scale != null ? o.scale : o.scaleY != null ? o.scaleY : 1

      if (!relative) {
        // absolute; multiply inversed values
        var e = matrix.extract()
        o.scaleX = o.scaleX * 1 / e.scaleX
        o.scaleY = o.scaleY * 1 / e.scaleY
      }

      matrix = matrix.scale(o.scaleX, o.scaleY, o.cx, o.cy)

    // act on skew
    } else if (o.skewX != null || o.skewY != null) {
      // ensure centre point
      ensureCentre(o, target)

      // ensure skew values on both axes
      o.skewX = o.skewX != null ? o.skewX : 0
      o.skewY = o.skewY != null ? o.skewY : 0

      if (!relative) {
        // absolute; reset skew values
        var e = matrix.extract()
        matrix = matrix.multiply(new SVG.Matrix().skew(e.skewX, e.skewY, o.cx, o.cy).inverse())
      }

      matrix = matrix.skew(o.skewX, o.skewY, o.cx, o.cy)

    // act on flip
    } else if (o.flip) {
      matrix = matrix.flip(
        o.flip
      , o.offset == null ? target.bbox()['c' + o.flip] : o.offset
      )

    // act on translate
    } else if (o.x != null || o.y != null) {
      if (relative) {
        // relative
        matrix = matrix.translate(o.x, o.y)
      } else {
        // absolute
        if (o.x != null) matrix.e = o.x
        if (o.y != null) matrix.f = o.y
      }
    }

    return this.attr('transform', matrix)
  }
64357
def transformMesh(self, transformation):
        
        if isinstance(transformation, vtk.vtkMatrix4x4):
            tr = vtk.vtkTransform()
            tr.SetMatrix(transformation)
            transformation = tr

        tf = vtk.vtkTransformPolyDataFilter()

        tf.SetTransform(transformation)
        tf.SetInputData(self.polydata())
        tf.Update()
        self.PokeMatrix(vtk.vtkMatrix4x4())  # identity
        return self.updateMesh(tf.GetOutput())
1010957
function appendTransform(defaults, transform) {
    defaults = angular.isArray(defaults) ? defaults : [defaults];
    return (transform) ? defaults.concat(transform) : defaults;
  }
1021803
void applyTransformation(Transformation2D transform) {
		m_vertices_mp.applyTransformation(transform);
		if (m_segments != null) {
			for (int i = 0, n = m_segments.size(); i < n; i++) {
				if (m_segments.get(i) != null) {
					m_segments.get(i).applyTransformation(transform);
				}
			}
		}
	}
936392
public function addTransforms(array $transforms)
    {
        foreach ($transforms as $transform => $value) {
            $this->addTransform($transform, $value);
        }

        return $this;
    }
463717
function (matrix) {
        Vector3.add(this.direction, this.direction, this.origin);
        Vector3.transformMat4(this.origin, this.origin, matrix);
        Vector3.transformMat4(this.direction, this.direction, matrix);

        Vector3.sub(this.direction, this.direction, this.origin);
        Vector3.normalize(this.direction, this.direction);
    }
426620
def transform(self):
        """"""
        ax = self.ax
        return {'axes': ax.transAxes,
                'fig': ax.get_figure().transFigure,
                'data': ax.transData}
938501
def add_transform_task(self, transformation, params):
        
        if not isinstance(self, filestack.models.Transform):
            instance = filestack.models.Transform(apikey=self.apikey, security=self.security, handle=self.handle)
        else:
            instance = self

        params.pop('self')
        params = {k: v for k, v in params.items() if v is not None}

        transformation_url = utils.return_transform_task(transformation, params)
        instance._transformation_tasks.append(transformation_url)

        return instance
1374021
def add_on_cpu(self, transforms):
        """"""
        if not isinstance(transforms, list):
            transforms = [transforms]
        self.cpu_transforms.extend(transforms or [])
        return self
252782
def transform(self, attrs):
        """"""
        self.collect(attrs)
        self.add_missing_implementations()
        self.fill_attrs(attrs)
607930
private void updateAdd()
    {
        if (willAdd)
        {
            for (final Featurable featurable : toAdd)
            {
                featurables.add(featurable);
                for (final HandlerListener listener : listeners)
                {
                    listener.notifyHandlableAdded(featurable);
                }
                if (featurable.hasFeature(Transformable.class))
                {
                    final Transformable transformable = featurable.getFeature(Transformable.class);
                    transformable.teleport(transformable.getX(), transformable.getY());
                }
            }
            toAdd.clear();
            willAdd = false;
        }
    }
1095016
function mapSync(transformation) {
    return through2.obj(function write(chunk, _, callback) {
      let mappedData;
      try {
        mappedData = transformation(chunk);
      } catch (error) {
        callback(error);
      }
      if (mappedData !== undefined) {
        this.push(mappedData);
      }

      callback();
    });
  }
1225485
def apply_trans_rot(ampal, translation, angle, axis, point, radians=False):
    """"""
    if not numpy.isclose(angle, 0.0):
        ampal.rotate(angle=angle, axis=axis, point=point, radians=radians)
    ampal.translate(vector=translation)
    return
842921
def reshape(attrs, inputs, proto_obj):
    """"""
    if len(inputs) == 1:
        return 'reshape', attrs, inputs[0]
    reshape_shape = list(proto_obj._params[inputs[1].name].asnumpy())
    reshape_shape = [int(i) for i in reshape_shape]
    new_attrs = {'shape': reshape_shape}
    return 'reshape', new_attrs, inputs[:1]
391277
def add_transform(self, key, xslt):
        
        self._remove_converter(key)
        self._xsltLibrary[key] = xslt
        self._add_converter(key)
1209095
function _transformShape(canvas, ctx, params, width, height) {

	// Get conversion factor for radians
	params._toRad = (params.inDegrees ? (PI / 180) : 1);

	params._transformed = true;
	ctx.save();

	// Optionally measure (x, y) position from top-left corner
	if (!params.fromCenter && !params._centered && width !== undefined) {
		// Always draw from center unless otherwise specified
		if (height === undefined) {
			height = width;
		}
		params.x += width / 2;
		params.y += height / 2;
		params._centered = true;
	}
	// Optionally rotate shape
	if (params.rotate) {
		_rotateCanvas(ctx, params, null);
	}
	// Optionally scale shape
	if (params.scale !== 1 || params.scaleX !== 1 || params.scaleY !== 1) {
		_scaleCanvas(ctx, params, null);
	}
	// Optionally translate shape
	if (params.translate || params.translateX || params.translateY) {
		_translateCanvas(ctx, params, null);
	}

}
1332661
public void transformation(Closure<?> closure) {
        transformations.add((Transformation) project.configure(new Transformation(project), closure));
    }