Functions |
Angle and Endpoint
Funtions
PointToVector(DrawXtra
member, integer x1, integer y1, integer x2, integer y2) - this will
calculate the angle and the magnitude (length of the line segment) of
a line given its start point and end point. The return value will be a
point structure with the angle being the 1st element in the structure
and the magnitude as the 2nd element.
Example: set myvector
to PointToVector(member "canvas", 10,10,20,20)
put myvector
-- point(135,
14)
VectorToPoint(DrawXtra
member, integer x1, integer y1, integer angle, integer magnitude) -
this will calculate the endpoint of a line give its start point, magnitude
and angle. The return value will be a point structure with the x-coordinate
being the 1st element in the structure and the y-coordinate as the 2nd
element.
Example: set mypoint
to VectorToPoint(member "canvas", 10,10,135,14)
put mypoint
-- point(20, 20)
|
|