Skip to main content

Home > blockly > utils > Coordinate > sum

utils.Coordinate.sum() method

Returns the sum of two coordinates as a new Coordinate.

Signature:

static sum(a: Coordinate | SVGPoint, b: Coordinate | SVGPoint): Coordinate;

Parameters

ParameterTypeDescription
aCoordinate | SVGPointAn x/y coordinate.
bCoordinate | SVGPointAn x/y coordinate.

Returns:

Coordinate

A Coordinate representing the sum of the two coordinates.