Botfathers 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
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.
var null_point = new Point();
var point = new Point(42, 128);
Point type methods
Returns the points x value.
x(number): The points new x value.
Sets the points x value to
Returns the points y value.
y(number): The points new y value.
Sets the points y value to
other_point(Point): The point to be added
Returns a Point object that is the sum of this point and other_point; each component is added separately.
other_point(Point): The point to be substracted
Returns a Point object that is formed by subtracting other_point from this point; each component is subtracted separately.
other_point(Point): Another point.
Returns the dot product of this point and the
Returns the sum of the absolute values of the points x and y coordinates, traditionally known as the “Manhattan distance” of the vector from the origin to the point.