#### Archived

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

# line from 2d vector and angle

This topic is 6058 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hello ive got a 2d point lets say 250,100 and a direction in degree lets say 15° how cann i construct a line from this thx, a lot

##### Share on other sites
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 on other sites
that was me!

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 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 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 on other sites
Sorry, couldn´t resist
Tan(dx/dy)????
It''s tan(angle) or atan(dx/dy)

##### Share on other sites
Yes, of course!

You were both right.
don''t know where I got that from.

But it cannot, still, handle vertical lines ...I think.

thanks

/Mankind gave birth to God.

• 10
• 16
• 14
• 18
• 15