Aimbot

Posts 1–15 of 15 · Page 1 of 1
Aimbot
So currently I'm working on my aimbot right, and I am thinking about using something like this as my main angle calculating function:

Code:
void MakeAngle(int DiffX, int DiffY, &Angle)
Now I need some code so I use after that

tan(x) = DiffX/DiffY (Or whichever is Opp and Adj i don't really wanna take the time to think about that shit now.

So my question is how do I go from the tangent of x, to just x = ????. Would I just do the atan of it? So like

Angle = atan(DiffX/DiffY)
Code:
#define PI  (3.1415927f)
#define RAD (PI / 180.0f)

void getyawpitch(const vec &from, const vec &to, float &yaw, float &pitch)
{
	float dist = from.dist(to);
	yaw = -(float)atan2(to.x-from.x, to.y-from.y)/PI*180+180;
	pitch = asin((to.z-from.z)/dist)/RAD;
}
Thats assaultcube's aimbot code, use d3dxvectors instead of vec
Quote Originally Posted by fukojr2 View Post
So currently I'm working on my aimbot right, and I am thinking about using something like this as my main angle calculating function:

Code:
void MakeAngle(int DiffX, int DiffY, &Angle)
Now I need some code so I use after that

tan(x) = DiffX/DiffY (Or whichever is Opp and Adj i don't really wanna take the time to think about that shit now.

So my question is how do I go from the tangent of x, to just x = ????. Would I just do the atan of it? So like

Angle = atan(DiffX/DiffY)
Code:
#define pi = 3.141592653
Code:
void MakeAngle(int DiffX, int DiffY, &Angle)
{
int radians = Angle * pi / 180
int oTan = DiffY/DiffX
oTan(Angle) = Result
}
I guess do something like that.. I know thats not 100% but should give you an idea
Quote Originally Posted by CAFlames View Post


Code:
#define pi = 3.141592653
Code:
void MakeAngle(int DiffX, int DiffY, &Angle)
{
int radians = Angle * pi / 180
int oTan = DiffY/DiffX
oTan(Angle) = Result
}
I guess do something like that.. I know thats not 100% but should give you an idea
What about if you like change the 180 to 90 so it will look more legit
Quote Originally Posted by lateef15 View Post
What about if you like change the 180 to 90 so it will look more legit
Really noob? Learn c++. the 180 is for converting Degrees it radians.
Quote Originally Posted by CAFlames View Post


Really noob? Learn c++. the 180 is for converting Degrees it radians.
LMAO!!
Quote Originally Posted by CAFlames View Post


Really noob? Learn c++. the 180 is for converting Degrees it radians.
More like learn math. Bitch please I'm 13 and even i know what that does. Thanks flames Ur the best.
If you change 180 to 90 you must change change the define of pi to (3.141592653/2)

Degrees / 180 * Pi = Radians
Radians / Pi * 180 = degrees
Wouldn't you define pi as pi*2 not pi/2?
Quote Originally Posted by fukojr2 View Post
Wouldn't you define pi as pi*2 not pi/2?
full circle = 2*pi = 360 degrees
half circle = pi = 180 degrees
1/4th circle = 0,5 * pi(or pi/2 if you wish) = 90 degrees
Quote Originally Posted by Hell_Demon View Post
If you change 180 to 90 you must change change the define of pi to (3.141592653/2)

Degrees / 180 * Pi = Radians
Radians / Pi * 180 = degrees
Now why would you bother doin that in the first place XD.
Ahhh I hate Calculus ~.~


Quote Originally Posted by fukojr2 View Post
Wouldn't you define pi as pi*2 not pi/2?
Nope. Imagine X * pi / 180.

Dividing by 180 is like multiplying by 1 over 180. So if you change 1 over 180 to 1 over 90... thats like changing it to 2 over 180.

So you are actually multiplying it by 2 by changing 180 to 90. In turn, you must then divide by 2 to get back to original.
Quote Originally Posted by CAFlames View Post


Now why would you bother doin that in the first place XD.
Ahhh I hate Calculus ~.~



Nope. Imagine X * pi / 180.

Dividing by 180 is like multiplying by 1 over 180. So if you change 1 over 180 to 1 over 90... thats like changing it to 2 over 180.

So you are actually multiplying it by 2 by changing 180 to 90. In turn, you must then divide by 2 to get back to original.


Fuck you flames you lost me on X jajajajajajajajajajajajajaja
Quote Originally Posted by fukojr2 View Post


Fuck you flames you lost me on X jajajajajajajajajajajajajaja
X would be the angle in degrees that you want converted to radians
Quote Originally Posted by fukojr2 View Post


Fuck you flames you lost me on X jajajajajajajajajajajajajaja
ugh... so if X * pi / 180 is converting X to raidans.... then if you want to use pi / 2, it would be mutlipling denomenator from 90 to 180... thus making it correct. to multiply pi by 2 and divide by 90 instead of 180, you are actually going to get an answer 4 times the actual result.

Quote Originally Posted by Hell_Demon View Post
X would be the angle in degrees that you want converted to radians
Yupperz
Quote Originally Posted by Hell_Demon View Post
X would be the angle in degrees that you want converted to radians
I got that part Wesley. OK Flames I get it, I wasn't planning on changing it anyways so...
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us