Archived

This topic is now archived and is closed to further replies.

blastig

line from 2d vector and angle

Recommended Posts

Guest Anonymous Poster
Your question is?!:
define a line through given point with given direction.

one solution in vector-parameter-notation:

y =( Pxcoord ) + t*( cos(angle) )
( Pycoord ) ( sin(angle) )


hope that clarifies


/Mankind gave birth to God.

Share this post


Link to post
Share on other sites
that was me!

Your question is?!:
define a line through given point with given direction.

one solution in vector-parameter-notation:

Yx = Pxcoord + t*cos(angle)
Yy = Pycoord + t*sin(angle)

hope that clarifies

/Mankind gave birth to God.

Edited by - silvren on October 16, 2001 12:54:54 PM

Share this post


Link to post
Share on other sites
first version:
y=k+m*x; m=atan(angle)
k is y offset , m is the angular coeff.

second version
x=x0+t*cos(angle)
y=y0+t*sin(angle)
thus , (l,m)=(cos(angle),sin(angle)); (-m,l) is an orthogonal vector , always usefull

third version
x=y/p+q where p=1/m ,q=k/m segmentary equation

i hope it helps , translate in to c .



Share this post


Link to post
Share on other sites
I think v71''s first version is "wrong" at one point:
atan(angle) was certainly meant to be tan(dy/dx) or something like that.

Anyway, it (1st version) cannot handle vertical lines, coz dy/dx wouldn''t exist!



/Mankind gave birth to God.

Share this post


Link to post
Share on other sites