Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

A simple question on mathematics

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
7 replies to this topic

#1 yasmin_bd   Members   

121
Like
0Likes
Like

Posted 22 January 2013 - 02:19 PM

I have one simple question. Figure 1 shows that if the line AB is extended, it somewhere intersects the rectangle at C. My question is how to find the intersection point C. I know the coordinates of A and B.

Attached Thumbnails

  • interpolation.jpg


#2 Álvaro   Members   

20904
Like
2Likes
Like

Posted 22 January 2013 - 02:43 PM

See if this recent thread helps you.

#3 haegarr   Members   

7359
Like
0Likes
Like

Posted 22 January 2013 - 02:45 PM

Ray with t as independent variable: R(t) := A + t * ( B - A )

 

An edge (exemplarily one of the four building the rectangle) with k1 as independent variable: E1(k1) := [-1,-1] + k1 * [1,0]

 

Then R(t) = E1(k) gives the point of intersection. These are 2 linear equations with 2 independents what can be solved symbolically. The result cannot be computed (or, to be precise, gives infinity of negative infinity) if R(t) is parallel or anti-parallel to E1(k1). Otherwise a specific pair (t',k1') can be computed. To be valid, k1' must be in the interval [0,+1], and t' must be greater than 0. If so, then R(t') and E1(k1) is the solution. Otherwise another edge has to be investigated.



#4 yasmin_bd   Members   

121
Like
0Likes
Like

Posted 22 January 2013 - 04:07 PM

I have one question. In equation R(t) = A + t*(B - A),  here t is 0 to 1 in between A and B. But this is something like extrapolation for C. Wil this work for extrapolation? Please clarify a bit.



#5 Paradigm Shifter   Members   

5832
Like
0Likes
Like

Posted 22 January 2013 - 04:10 PM

Of course it will work, it's a straight line that goes off to infinity, in both directions ;)
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#6 yasmin_bd   Members   

121
Like
0Likes
Like

Posted 22 January 2013 - 04:27 PM

Ok, then will the value of 't' be greater than 1 in this case?



#7 Paradigm Shifter   Members   

5832
Like
0Likes
Like

Posted 22 January 2013 - 04:30 PM

Yeah, if the point is further along the line from A to B (beyond B), it will be greater than 1.
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#8 Aphton   Members   

356
Like
0Likes
Like

Posted 23 January 2013 - 11:19 AM

Damn formatting =/

Edited by Aphton, 23 January 2013 - 11:32 AM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.