CODEOBJ :: get_coord


protocol:
method

parameters:

none

result:

structure with members (x1, y1, x2, y2) for lines rectangles etc, or a structure with members (x, y, r) for circles

description:

Get the co-ordinates of the object to which this method is applied.

For a line x1,y1 is the start of the line and x2,y2 is the end of the line.

For a rectangle x1,y1 is the top left hand corner and x2,y2 is the bottom right hand corner.

For a circle x,y is the centre of the circle and r is the radius

example:

to calculate the width of a code object 'cobj'
 
coord   =   cobj . get_coord()
 
width   =   coord . x2   -   coord . x1