Welcome to Inkbunny...
Allowed ratings
To view member-only content, create an account. ( Hide )
Ask Keysee and Friends #38
« older newer »
FreePi
FreePi's Gallery (425)

Predictive Aim

Keysee Pointing Up

Medium (920px wide max)
Wide - use max window width - scroll to see page ⇅
Fit all of image in window
set default image size: small | medium | wide
Download (new tab)
by FreePi
Is this right?

Keywords
male 1,169,913, robot 18,163, game 12,312, ai 6,113, ball 6,069, gold 3,827, bill 556, math 168, paul 118
Details
Type: Picture/Pinup
Published: 2 years, 5 months ago
Rating: General

MD5 Hash for Page 1... Show Find Identical Posts [?]
Stats
77 views
1 favorite
7 comments

BBCode Tags Show [?]
 
Rios30
2 years, 5 months ago
It is correct indeed, But it won't hurt if you test it with a trivial triangle like the ABC (1,0) (0,1) (1,1)
thats the isosceles rectangle-triangle that has a2 = 45° angle, so it should yield the same for the last equation step

Suppose (1,0) "d"  (0,1) "v1" and v2 =  d + v1 or (1,1)  the trickery here is that you have to take the Pythagoras geometric mean  in order for them to fit in the arcsin argument, so Arcsin ( sqrt(1*1) *sin(90)) / sqrt(1*1+1*1) = arcsin(1/sqrt(2)) = 45°

Alternatively If you were wondering what are the d and t for, they are used to  craft the v2 (x,y) vector  by knowing its y components are always the same as in v1(y) component, (because that is the condition for them to impact)
and that vector (x) component is given by Distance that is Bullet Speed (x) * t, minus the v1(x) components ( because thats is how you make a line or make vectors from 2 points) you get
v2= (d(x)-v1(x) ,  v1(y))
 
and to get the angle of a vector you just feed it to an arctan as (Y/X) so arctan(v1(y) / (d(x)-v1(x)) ...  which in the trivial isosceles triangle its equivalent to just add arctan( v2) = arctan (1,0)+(0,1) = arctan (1,1) = arctan (1/1) = 45°

  

Rios30
2 years, 5 months ago
Note: if you don't multiply every vector by the same value of t, its still like if you would have done so for a t = 1 so you either multiply everything by a given t value or you just don't  
FreePi
2 years, 5 months ago
I'm glad someone cares about this math stuff that I post.
Rios30
2 years, 5 months ago
thats ok, don't worry, If t is unknown you can either leave it as a variable and  just write them algebraic as v*t  or just solve for t as distance(x) + v2(x)*t - v1(x)*t = 0 where zero is the condition for they to meet,

hint 3 if bullet speed is a constant than its a polar velocity whose vector component  v2(x,y)  = (speed * cos(Θ), speed sin (Θ)) where Θ is just a2)  where we already know that speed sin(Θ) must be the same speed of  v1(y) in order for them to impact so solving for v2(x) on a pythagoras geometric mean, sqrt( (v2(x) -v1(x))² + v1(y)² ) = bullet speed,
 that would correlate the (x,y) speed needed for a collision, you would still need to add later a compensation for distance as (x)/t as and added x speed, Or just by shooting t seconds early in  distance(x) v(x)t - v2(x)t = 0
Rios30
2 years, 5 months ago
also for the shooting early case you would need to make an assumption if v(2) is 0 until bullet speed (x)*t' matches distance
in which case v2(y) would need to be recalculated as an "arithmetic mean"(v2+0)*(t/(t+t')) as you want that to become slower if and if speed is preserved, (v2)*(t/(t-t')) as you would want to grow faster


Rios30
2 years, 5 months ago
sqrt( (v2(x) -v1(x))² + v1(y)² ) = bullet speed + a tweak?I just forgot what I was doing here

lets tidy it up into an algebraic  formulary
simplified one sqrt( (v2(x)² +  v1(y)²) = bullet speed
v2(x) = sqrt((bullet speed)² -  v1(y)²))
angle a2 = arctan (v1(y) / (sqrt((bullet speed)² -  v1(y)²)))  

as long as the vectors share the y component and  y position along v2(x)>v1(x) they will intersect eventually
then distance(x) + v1(x)t - v2(x)t = 0
v(x1-x2)t = -distance(x)
t = -distance(x)/(x1-x2)





  
Rios30
2 years, 5 months ago
Note 2, the above assumes that both the projectile and the target share the same starting y point position, as the picture implies,
for distinct y positions v2(y) component needs to compensate for v1(y) speed, ie v2 (x,y) = (x,v1(y) + ((delta of y point of  (player - enemy position)/time of impact)) those points are unnamed so they likely are inconsequential
New Comment:
Move reply box to top
Log in or create an account to comment.