# Map Points calculate x and y for arrow

#### kiloeras

Hello there.
I'm doing some software with Silverlight.

I'm drawing some Polylines in a Map, given some points.

In the first photo, there are shown three points.
They are connected with some esri polyline function.

But now I need to draw an arrow figure at the end of the line connected to the various points.
So for me to be able that arrow figure I need to figure the x and y point on which that arrow will be.
(For this I meant what can be seet on the second image x=? and y=?)

The system is coordinate system of the planet.

I will be very glad if you could help me.
The x and y data are not exactly accurate, but I hope you can tell me the way of calculating those points to simulate the arrow.

The angle of the arrow is important.

#### Attachments

• 114.2 KB Views: 5

#### Yooklid

Here's a little routine that I wrote in Basic a few months ago:
Code:
Sub DrawArrow(x1, y1, x2, y2)
// Draws a line x1y1,x2y2 with arrowhead at the x2y2 end
const deg2halfrad = 0.008726646259972
const arrowLength = 20 'Pixels
const arrowAngle = 30 'degrees
// Calculate angle of line
aLine = ATan2(y2-y1,x2-x1)
// calculate angle of arrowhead lines
ahLineA = aLine-mArrowAngle*deg2halfrad
ahLineB = aLine+arrowAngle*deg2halfrad
// calculate x and y coordinates of the arrowhead points
ahLineAx = x2-mArrowLength*cos(ahLineA)
ahLineBx = x2-mArrowLength*cos(ahLineB)
ahLineAy = y2-mArrowLength*sin(ahLineA)
ahLineBy = y2-mArrowLength*sin(ahLineB)
// Draw the principal line
DrawLine(x1,y1,x2,y2)
// Draw two line segments for arrowhead
DrawLine(ahLineAx,ahLineAy,x2,y2)
DrawLine(ahLineBx,ahLineBy,x2,y2)
End Sub

Similar threads