DegreesToXY

Calculates X, Y of position on a Circle or ellipse.
Pass the center X, Y of your ellipse, the degree position, and the horizontal and vertical radii (if they are equal, you're specifying a circle, If not, it is an elongated ellipse).

CodeFunctionName
What is this?

Public

Not Tested

Imported
' ===================================================================
' By: StonePage
' Inputs: Pass the subroutine the center X, Y of your ellipse, the degree position, and the horizontal and vertical radii (if they are equal, you're specifying a circle, If not, it is an elongated ellipse).
' Returns: Coordinates in the X and Y parameters.
' Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=460&lngWId=1
' ===================================================================
Sub DegreesToXY(CenterX, CenterY, Degree, radiusX, radiusY, X, Y)
    Dim Convert
    Convert = 3.141593 / 180 ' pi divided by 180
    X = CenterX - (Sin(-Degree * Convert) * radiusX)
    Y = CenterY - (Sin((90 + (Degree)) * Convert) * radiusY)
End Sub

CenterX , CenterY , Degree , radiusX , radiusY, X , Y

Views 651

Downloads 154

CodeID
DB ID