21.07.2013, 20:25
floatsin returns sine of an angle (which is a float), whereas asin is an inverse function of sine (sine^-1). For example:
floatsin(60, degrees) ~ 0.866,
asin(0.866) ~ 60°.
This creates a specific number or objects equally distributed around a point.
floatsin(60, degrees) ~ 0.866,
asin(0.866) ~ 60°.
This creates a specific number or objects equally distributed around a point.
pawn Код:
stock CreateCircleAroundpoint(objectid, Float:x, Float:y, Float:z, Float:radius, OBJECT_NUMBER)
{
new Float:x2, Float:y2, Float:angle = 360/(OBJECT_NUMBER), Float:a = 0.0;
for(new i=0; i<OBJECT_NUMBER; i++)
{
printf("%f",a);
x2 = x + floatcos(a,degrees) * radius;
y2 = y + floatsin(a,degrees) * radius;
a += angle;
CreateObject(objectid, x2, y2, z, 0.0,0.0,0.0);
}
}

