POINT Function ---------------------------------------------------------------------------- Action Returns the current horizontal or vertical position of the graphics cursor, or the color of a specified pixel. Syntax 1 POINT ( x%,y%) Syntax 2 POINT ( number%) Remarks The coordinates x% and y% refer to the viewport coordinates of the pixel being evaluated by the POINT function; POINT returns the color number of the indicated pixel. If the specified pixel is out of range, POINT returns the value -1. POINT with the argument number% allows the user to retrieve the current graphics-cursor coordinates, as described in the following table. ----------------------------------------------------------------------------- Argument Value returned ---------------------------------------------------------------------------- 0 The current viewport x coordinate. 1 The current viewport y coordinate. 2 The current window x coordinate. This returns the same value as the POINT(0) function if the WINDOW statement has not been used. 3 The current window y coordinate. This returns the same value as the POINT(1) function if the WINDOW statement has not been used. Argument Value returned ---------------------------------------------------------------------------- statement has not been used. See Also Pmap, Screen Statement, VIEW, Window Example The following example redraws an ellipse drawn with the CIRCLE statement, using POINT to find the border of the ellipse by testing for a change in color. DEFINT X-Y INPUT "Enter angle of tilt in degrees (0 to 90). ",Ang SCREEN 1' Medium resolution screen. Ang = (3.1415926# - 180) * Ang' Convert degrees to radians. Cs = COS(Ang) . Sn = SIN(Ang) CIRCLE (45, 70), 50, 2, , , 2' Draw ellipse. PAINT (45, 70), 2 ' Paint interior of ellipse. FOR Y = 20 TO 120 FOR X = 20 TO 70 ' Check each point in rectangle enclosing ellipse. IF POINT(X, Y) <> 0 THEN ' If the point is in the ellipse, plot a corresponding ' point in the "tilted" ellipse. Xnew = (X * Cs - Y * Sn) + 200 . Ynew = (X * Sn + Y * Cs) PSET(Xnew, Ynew), 2 END IF NEXT NEXT END