fromPoints

Creates a Rect instance that contains the points given as arguments.

Example

<script>
var geom = kendo.geometry;
var point1 = new geom.Point(5, 10);
var point2 = new geom.Point(20, 5);
var point3 = new geom.Point(15, 25);

// Create rectangle that contains all points
var rect = geom.Rect.fromPoints(point1, point2, point3);

console.log("Rectangle origin:", rect.origin.x, rect.origin.y); // 5, 5
console.log("Rectangle size:", rect.size.width, rect.size.height); // 15, 20
</script>

Parameters

pointA kendo.geometry.Point

The first point.

pointB kendo.geometry.Point

The second point.

Multiple arguments are accepted.

Returns

kendo.geometry.Rect The new Rect instance.

In this article
fromPoints
Not finding the help you need?
Contact Support