How to calculate atan2 in cleo script for gta sa android?

Gdzin

New member
Joined
Jul 23, 2023
Messages
4
Reaction score
0
Como calcular atan2 no script cleo para gta sa android?
 

Kross

Active member
Joined
Dec 15, 2021
Messages
149
Reaction score
42
1691254061963.png
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
 

Gdzin

New member
Joined
Jul 23, 2023
Messages
4
Reaction score
0
the method calling the atan2 function from memory is not possible because there is no direct function that calculates atan2 in the arm architecture, only in the x86 architecture which is fpatan, and the other method is not possible either because there is no opcode 0C08: math 31@ = arctangent 30@ // (float)
 

Gdzin

New member
Joined
Jul 23, 2023
Messages
4
Reaction score
0
0086: $Point_X = $Enemy_X
0086: $Point_Y = $Enemy_Y
0061: $Point_X -= $Camera_X
0061: $Point_Y -= $Camera_Y
0061: $Enemy_Z -= $Camera_Z
0604: get_Z_angle_for_point $Point_X $Point_Y store_to $Angle_Z
$Angle_Z -= 90.0
$Angle_Z /= 57.29578
0509: $Distance = distance_between_XY $Camera_X $Camera_Y and_XY $Enemy_X $Enemy_Y
// $Angle_X = atan2($Distance, $Enemy_Z);
0A25: set_camera_on_players_X_angle $Angle_X Z_angle $Angle_Z


is there any other way to make this aimbot work?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
0086: $Point_X = $Enemy_X
0086: $Point_Y = $Enemy_Y
0061: $Point_X -= $Camera_X
0061: $Point_Y -= $Camera_Y
0061: $Enemy_Z -= $Camera_Z
0604: get_Z_angle_for_point $Point_X $Point_Y store_to $Angle_Z
$Angle_Z -= 90.0
$Angle_Z /= 57.29578
0509: $Distance = distance_between_XY $Camera_X $Camera_Y and_XY $Enemy_X $Enemy_Y
// $Angle_X = atan2($Distance, $Enemy_Z);
0A25: set_camera_on_players_X_angle $Angle_X Z_angle $Angle_Z


is there any other way to make this aimbot work?
Just make your own function of arctangent...
Use Google to find out how it works and start making calculations...
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
Example:
PHP:
def arctan(x, terms):
    result = 0
    sign = 1

    for n in range(1, 2*terms, 2):
        term = sign * (x ** n) / n
        result += term
        sign *= -1

    return result

x = 0.5 # Value for which you want to calculate arctan
terms = 10 # Number of terms in the series

approx_arctan = arctan(x, terms)
print(approx_arctan)

This code snippet calculates an approximation of the arctangent of 0.5 using the Taylor series expansion with 10 terms. You can adjust the x value and the number of terms (terms) to see how the approximation changes.

Remember that while this approach works for small values of x, it may not be the most efficient or accurate method for larger values.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
C++ example
C++:
#include <iostream>
#include <cmath>

double arctan(double x, int terms) {
    double result = 0.0;
    double sign = 1.0;

    for (int n = 1; n <= 2 * terms; n += 2) {
        double term = sign * (std::pow(x, n) / n);
        result += term;
        sign *= -1.0;
    }

    return result;
}

int main() {
    double x = 0.5; // Value for which you want to calculate arctan
    int terms = 10; // Number of terms in the series

    double approx_arctan = arctan(x, terms);
    std::cout << "Approximate arctan(" << x << ") = " << approx_arctan << std::endl;

    return 0;
}
 
Top