SA-MP Forums Archive
Mathematics in SAMP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mathematics in SAMP (/showthread.php?tid=637665)



Mathematics in SAMP - cngzn61 - 19.07.2017

Hello guys, How can ı learn Mathematics in SAMP (floatsin, floatcos, floattan, floatpower, floatsqroot, floatabs, floatlog etc.)


Re: Mathematics in SAMP - AbyssMorgan - 19.07.2017

The same as human math. If you need 3D Math Operations use 3DTryg.inc


Re: Mathematics in SAMP - Kaperstone - 19.07.2017

By going to a math course/class.


Re: Mathematics in SAMP - cngzn61 - 19.07.2017

Код:
stock GetVehicleHood(vehicleid, &Float:x, &Float:y, &Float:z)
{
    if (!GetVehicleModel(vehicleid) || vehicleid == INVALID_VEHICLE_ID)
        return (x = 0.0, y = 0.0, z = 0.0), 0;

    static
        Float:pos[7]
    ;
    GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, pos[0], pos[1], pos[2]);
    GetVehiclePos(vehicleid, pos[3], pos[4], pos[5]);
    GetVehicleZAngle(vehicleid, pos[6]);

    x = pos[3] + (floatsqroot(pos[1] + pos[1]) * floatsin(-pos[6], degrees));
    y = pos[4] + (floatsqroot(pos[1] + pos[1]) * floatcos(-pos[6], degrees));
    z = pos[5];

    return 1;
}
x = pos[3] + (floatsqroot(pos[1] + pos[1]) * floatsin(-pos[6], degrees));
y = pos[4] + (floatsqroot(pos[1] + pos[1]) * floatcos(-pos[6], degrees));
z = pos[5];

in this code you see x pos 3 y pos 4 pos 5 why we make code like this why we make addition and substraction


Re: Mathematics in SAMP - Mauzen - 19.07.2017

https://en.wikipedia.org/wiki/Trigonometry

Thats usually matter of 7th or 8th grade in school.


Re: Mathematics in SAMP - cngzn61 - 19.07.2017

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
https://en.wikipedia.org/wiki/Trigonometry

Thats usually matter of 7th or 8th grade in school.
Yes ı know but ı talking about samp that different


Re: Mathematics in SAMP - Kaperstone - 19.07.2017

Quote:
Originally Posted by cngzn61
Посмотреть сообщение
Yes ı know but ı talking about samp that different
How is it different?

Math is math.


Re: Mathematics in SAMP - AbyssMorgan - 19.07.2017

Every math is the same, you do not understand her.


Re: Mathematics in SAMP - cngzn61 - 19.07.2017

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
Every math is the same, you do not understand her.
Okey teach me ?


Re: Mathematics in SAMP - Toroi - 19.07.2017

Quote:
Originally Posted by cngzn61
Посмотреть сообщение
Okey teach me ?
You won't get yourself a personal math teacher from sa-mp forums.

Seriously, what is wrong with you?

Additions on paper:

Код:
a = b + c
Additions in pawn:

Код:
a = b + c;
how is it different