PtToAngle
PtToAngle Obtain angle between point and rectangle center Rect *theRect ; rectangle of interest Point thePt ; point, inside or outside of the rectangle short *angle ; receives angle measurement; 0-359
PtToAngle determines an angular measure between the vertical center of a rectangle and a specified point.
theRect is the address of an 8-byte Rect structure. thePt is a point, in the same coordinate system as theRect .
angle is the address of an integer. Upon return, it will contain an angle
measured from a line extending from the center of theRect to the
middle of its top line. See the diagram, below.
Notes: This can be used to obtain an angle value for use in any of the arc paint and
fill functions that require an angle parameter.
The angle is not a true mathematical angle in circular degrees; as with arc and wedge functions, all angles are based on the corners of a rectangle as
shown:
Thus, the angles are distorted to match the shape of the rectangle. For
instance:
In the figures, both "angles" are 45°, even though the one on the right is
obviously less acute.