Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ ¹ ² ³ °
 

You are not logged in. #1 20051204 22:00:12
calculate position c based on position a and bHi there, #2 20051204 22:49:54
Re: calculate position c based on position a and bIt is actually easy if you know more about the position of A and B. You probably won't need sine or cosine. "The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  Leon M. Lederman #3 20051205 00:34:02
Re: calculate position c based on position a and bThanks a lot for responding so quick and great forum (it took me about 5 secs of googling to find it)! #4 20051205 01:06:08
Re: calculate position c based on position a and bYou have a points A and B, (ax, ay) and (bx, by). The vector between these two points is <ax  bx, ay  by>, going from B to A. Now what you need is the unit vector. To get this, we divide that vector by it's length. So let L = √( (ax  bx)² + (ay  by)² ), which is the length. <(ax  bx) / L, (ay  by) / L> is the unit vector. Then multiply this by the distance you want the camera, D: <D*(ax  bx) / L, D*(ay  by) / L>. Last edited by Ricky (20051205 01:39:49) "In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..." #5 20051205 03:00:49
Re: calculate position c based on position a and bThanks Ricky, I think I got it to work. #6 20051205 06:42:33
Re: calculate position c based on position a and bAh, sorry, I misread your post. But yes, that is precisely right. By multiplying the vector by 1, you are reversing it's direction, so in front becomes behind. "In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..." 