Re: A86: Vector


[Prev][Next][Index][Thread]

Re: A86: Vector




This way is about the simplest:

Xi = cos(angle)	  	; get the increment value
Yi = sin(angle)		; for each unit in the test
while (no_intersection)	; assume X and Y are set to starting [X, Y]
{
  ; check for intersection here
  X = X + Xi        		; add the increment value
  Y = Y + Yi			; since we're done with this square
}

I'm not sure how the grid is setup and what you are looking to check with,
otherwise I'd show you how.  Sorry it's not in asm, but this is easier to
read.


At 10:59 PM 6/2/98 EDT, you wrote:
>
>How do I 'cast' out a line from [X,Y] at a given angle, and trace it as it
>goes out, until it intersects a line on a 16x8 grid.  Then recording the
[X,Y]
>coordinates of that intersection?
>
>I'm thinking I'm gonna have to make a table of tangent values from 0 to
>359...ugh.
>
>


// David Phillips
// mailto:electrum@tfs.net
// AIM: electrum32


References: