8
votes
7answers
1k views

What's the best way of translating a 2D vector into the closest 8-way compass direction?

If you have a 2D vector expressed as x and y, what's a good way of translating that into the closest compass direction? e.g. x:+1, y:+1 => NE x:0, y:+3 => N x:+10, y:-2 => E // closest ...
0
votes
2answers
160 views

How do I make a vector exactly reach a line?

Let's say a vector starts at Point P and points in the direction of v. How do I make sure that this vector exactly reaches the line? Its end should be exactly on the line, and not cross it.
-1
votes
2answers
201 views

How to make sure that a Point A moving in the direction V reaches at Point B?

Let say I have, Point A(X1,Y1) moving in the direction V(W, H). I need to make sure that it reaches B(X2,Y2). I think I need to subtract some value in Point A(X1, X2). But not know what? I also sure ...
2
votes
1answer
193 views

Calculate the direction, From Outer Polygon Point to Inner Polygon inside Point

I was able to find the co-ordinates of inner Polygon using this trick. Need the co-ordinates of innerPolygon But, I have some problem in getting the direction from Outer Polygon Point to Inner ...
3
votes
2answers
95 views

Need the co-ordinates of innerPolygon

Let say I have this diagram, Given that i have all the co-ordinates of outer polygon and the distance between inner and outer polygon is d is also given. How to calculate the inner polygon ...