Shadowing Posted July 30, 2012 Share Posted July 30, 2012 I'm completly lost on how to solve this. The first theory i had didnt work lol I"m some what decent with trionometry but i just cant figure out how to solve it. Made a picture to show what im trying to do I need to find the global location of S which is the bx and by Really hope someone knows how to do this Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/ Share on other sites More sharing options...
Pikachu2000 Posted July 30, 2012 Share Posted July 30, 2012 If you have x/y cooordinates of the start and end points, it should be simple pythagorean theorem stuff. Does c2 = a2 + b2 look familiar? Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365464 Share on other sites More sharing options...
Shadowing Posted July 30, 2012 Author Share Posted July 30, 2012 its more complicated then that I already did that part of the math thats what Distance is 1627.88px The problem is figuring out where its at globaly not just where its at between P1 and P2 Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365475 Share on other sites More sharing options...
Pikachu2000 Posted July 30, 2012 Share Posted July 30, 2012 So then where does S come from? If you know its origin and endpoint, which it appears you do, it's still the Pythagorean theorem you'd use to figure out the distance. Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365477 Share on other sites More sharing options...
Shadowing Posted July 30, 2012 Author Share Posted July 30, 2012 S is traveling from P1 to P2 and its 40 percent there already I already know the distance its 1627.88. using the Pythagorean theorem like you mentioned I need to find where S is at right now on the map. I think i need to use Tangent and Cosine to figure it out. S is located Bx ___ by ____ also i need to know the bx by on a global scale not just with in the block Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365480 Share on other sites More sharing options...
Pikachu2000 Posted July 30, 2012 Share Posted July 30, 2012 If you know the distance between P1 and P2, and that distance is 1627.88, and you know S is 40% of that, then the distance traveled is D * 40%, or 1627.88 * 40 / 100. Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365483 Share on other sites More sharing options...
Shadowing Posted July 30, 2012 Author Share Posted July 30, 2012 ya i have that figured on the map also for traveled under s 651.15px that doesnt give me global position though Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365485 Share on other sites More sharing options...
Shadowing Posted July 30, 2012 Author Share Posted July 30, 2012 maybe its as simple as grabing 40 percent from P1 bx and by global and P2 bx and by global. going to try that see what results i get Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365487 Share on other sites More sharing options...
Shadowing Posted July 30, 2012 Author Share Posted July 30, 2012 Updated my picture showing the global position of P1 and P2 Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365491 Share on other sites More sharing options...
thomasw_lrd Posted July 30, 2012 Share Posted July 30, 2012 Since you know where p1 is globally, you should be able to use pythagorean theorem to find where S is right now. Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365492 Share on other sites More sharing options...
Shadowing Posted July 30, 2012 Author Share Posted July 30, 2012 The pythagorean theorem only finds the Hypotenuse of a triangle which is 1 number and finding 40 percent of that is only giving me the location of where its at on the hypotenuse that doesnt tell me where S is located on the map Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365496 Share on other sites More sharing options...
Shadowing Posted July 30, 2012 Author Share Posted July 30, 2012 adding 40 percent to the P1 global positions "bx" and subtracting 40 percent from P1 global postiion "by" does give me where its at for example P1 "bx" is 1000. so add 40 percent which is 1400. which places S at "bx" 1400 but if i was going the oppisite direction it would be reversed subtract 40% to "bx" and add 40% to "by" trying to think writing a statement for that would work. so really this is a geometry problem maybe excluding the trig i used to find distance. I'm going to look up gemetry formulas Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365502 Share on other sites More sharing options...
thomasw_lrd Posted July 30, 2012 Share Posted July 30, 2012 yeah, I'm lost now. Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365506 Share on other sites More sharing options...
Christian F. Posted July 30, 2012 Share Posted July 30, 2012 Find the ratio of how many px up it moves for each px laterally. Then it should be quite simple to find the position, especially if you have the distance travelled already. You can use the positions of P1 and P2 to figure out this ratio, by taking P2-P1 for each X and Y then divide the two results with each other. Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365512 Share on other sites More sharing options...
Shadowing Posted July 31, 2012 Author Share Posted July 31, 2012 Thanks responces everyone I got it figured out. You are right christian your way is kinda like how i got it figured out. I dont have to devide anything though xd = P1_bx + ((P2_ bx - P1_bx ) * percent traveled which was 40 percent) yd = P1_by + ((P2_by - P1_by) * percent traveled which was 40 percent) so filling in the numbers would be bx = 1000 + ((2200 - 1000) * .40) by = 1700 + ((600 - 1700) * .40) return bx = 1480 by = 1260 Quote Link to comment https://forums.phpfreaks.com/topic/266464-searching-for-a-math-genius/#findComment-1365593 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.