zip thats what this needs! thankyou!
BTW I think it would much more useful to have a R2P function and an P2R function. But how do you return two values? I guess you make it a sub and change the inputs to outputs, ie x, y in and angle, distance out for R2P and the reverse for P2R.
Like this:
BTW I think it would much more useful to have a R2P function and an P2R function. But how do you return two values? I guess you make it a sub and change the inputs to outputs, ie x, y in and angle, distance out for R2P and the reverse for P2R.
Like this:
Code: (Select All)
x = 10: y = 10
R2P x, y
Print x, y
P2R x, y
Print x, y
Sub R2P (XinAngleoutDegrees, YinDistanceOut)
x = XinAngleoutDegrees
y = YinDistanceOut
XinAngleoutDegrees = _R2D(_Atan2(y, x))
YinDistanceOut = Sqr(x * x + y * y)
End Sub
Sub P2R (AngleInDegreesXout, DistanceInYout)
a = _D2R(AngleInDegreesXout)
AngleInDegreesXout = DistanceInYout * Cos(a)
DistanceInYout = DistanceInYout * Sin(a)
End Sub
b = b + ...