Point Type

Botfather’s script engine provides an inbuild Point type. Use it to represents points in your bot scripts. Some Botfather Api methods even require you to pass parameters being Point objects to them.

Table of contents

Point type instanciation

New Point objects can be created proving either the points x and y values or nothing, which results in an point with x, y coordiantes of 0.

Point type methods


Point.getX();

Returns the points x value.

Point.setX(x);

Sets the points x value to x.

Point.getY();

Returns the points y value.

Point.setY(y);

Sets the points y value to y.

Point.pointAdded(other_point);

Returns a Point object that is the sum of this point and other_point; each component is added separately.

Point.pointSubtracted(other_point);

Returns a Point object that is formed by subtracting other_point from this point; each component is subtracted separately.

Point.dotProduct(other_point);

Returns the dot product of this point and the other_point.

Point.distanceTo(other_point);

Returns the distance from this point to the other_point.