Advertisement
7_2009-2012 Custom Controls/ Forms/ Menus #217308

DegreesToXYsubroutine

The DegreesToXYsubroutine, calculates the X (horizontal) and Y (vertical) coordinates of any point, measured in degrees, on the circumference of a circle or ellipse.

AI

AI Samenvatting: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Broncode
original-source
Public Sub DegreesToXY(CenterX As _
    Long, CenterY As Long, degree _
    As Double, radiusX As Long, _
    radiusY As Long, X As Long, Y _
    As Long)
Dim convert As Double
    convert = 3.141593 / 180 
    'pi divided by 180
    X = CenterX - (Sin(-degree * _
        convert) * radiusX)
    Y = CenterY - (Sin((90 + _
        (degree)) * convert) * radiusY)
End Sub
SET the cursor position
var
x, y: integer; (* Position to set for the mouse *)
begin
(*These are only numbers examples*)
x := 10;
y := 60;
setcursorpos(x,y);
end;
Upload
Originele reacties (3)
Hersteld van de Wayback Machine