tool to output xy from an input xy, distant, and angle [closed]

I want to build a tool where you provide coordinates, distance, and angle for input and it outputs coordinates, no feature necessary, using the distance and angle from the input coordinates.

How do I build this?

I am using ArcMap for desktop 10.4.1

• As per the Tour there should be no chit chat in questions asked here. For example, yours contained unnecessary verbiage like "My question is" and "Thanks" that I have removed. Please do not roll that back. Also, the first tag on any ArcMap question should be arcgis-desktop if you want your question to be seen by the ArcGIS Desktop product experts who use the ArcMap application.
– PolyGeo
Jan 12 '18 at 0:33

This python code will do it using sine and cosine. Python requires radians for trig functions so it converts your angle in degrees to radians first.

``````def Translate(X,Y,angle,distance):                #defines function
# 0 degrees = North, 90 = East, 180 = South, 270 = West
dY = distance*math.cos(math.radians(angle))   #change in y
dX = distance*math.sin(math.radians(angle))   #change in x
Xfinal = X + dX
Yfinal = Y + dY
return Xfinal, Yfinal
``````
• Can you explain why x uses cosine and y uses sine? I have seen this answer before on other questions and I can simply use the calculation but I do not understand why it is being done Jan 11 '18 at 14:27
• I have edited my answer. Cosine divides the coordinate adjacent to the angle over the total distance, Sine divides the coordinate opposite the angle by the total distance. I use python for both physics and geography and my answer was using the angles which are standard in physics with 0 degrees pointing to the right (+ x axis) and angles going counter clockwise. In geography 0 degrees points north (+ y axis) and angles go clockwise so the trig functions are reversed. dX = Dist * sin(Angle) and dY = Dist * cos(Angle). Jan 15 '18 at 22:14

ArcGIS has a tool that does most of what you are after called Bearing Distance to Line. All you would need to do is extract the coordinates from the end point on the line created from the tool using a Search Cursor.

• Yeah, but that outputs a feature, which I don't want. I just want an output box that displays the new coordinates Jan 8 '18 at 15:49