27.11.2018, 15:30
Код:
new Float:centerX = 0.0;//center of the circle new Float:centerY = 0.0;//center of the circle new Float:radius = 3.0;//radius of the circle new Float:random = frandom(0, 6.28); new Float: px = centerX/2+floatcos(random,degrees)*radius; new Float: py = centerY/2+floatsin(random,degrees)*radius; printf("x%f y%f",px,py);
Код:
Float:frandom(Float:max, Float:min = 0.0, dp = 4)//made by ****** { new Float:mul = floatpower(10.0, dp), imin = floatround(min * mul), imax = floatround(max * mul); return float(random(imax - imin) + imin) / mul; }