Class: rectangle

rectangle(x, y, w, h, lat, long)

Rectangle base class

Constructor

new rectangle(x, y, w, h, lat, long)

Parameters:
Name Type Description
x Number the screen x coordinate
y Number the screen y coordinate
w Number the screen width
h Number the screen height
lat Number the latitude in degrees
long Number the longitude in degrees
Source:

Classes

rectangle

Methods

bottom()

Source:
Returns:
The bottom y pos of the rectangle

intersects(rectangle)

Checks for intersection with a given rectangle
Parameters:
Name Type Description
rectangle rectangle
Source:
Returns:
true if the rectangles are intersecting

latLong()

Source:
Returns:
The lat long as an array [lat, long]

left()

Source:
Returns:
The left x pos of the rectangle

max()

Source:
Returns:
The maximum point of the rectangel

min()

Source:
Returns:
The minimum point of the rectangel

original_point()

Source:
Returns:
The original point as an array with x at index 0 and y at index 1

point()

Source:
Returns:
The current point as an array with x at index 0 and y at index 1

reset(coords)

Resets the rectangle to the given coordinates, changes orig pos.
Parameters:
Name Type Description
coords
Source:
Source:
Returns:
The right x pos of the rectangle

top()

Source:
Returns:
The top y pos of the rectangle

xOverlap(other)

Calculates the overlap in x direction according to their x ranks. Return Infinity if the ranks are identical and 0 if there is no overlap.
Parameters:
Name Type Description
other rectangle
Source:
Returns:
The overlap in x direction according to their x ranks.

yOverlap(other)

Calculates the overlap in y direction according to their y ranks. Return Infinity if the ranks are identical and 0 if there is no overlap.
Parameters:
Name Type Description
other rectangle
Source:
Returns:
The overlap in y direction according to their y ranks.