Answers:
当然,端点与原点之间的距离为800米。在x坐标方向上的位移与角度的正弦成正比(向北),在y坐标方向上的位移与角度的余弦成正比。
因此,从sin(15度)= sin(0.261799)= 0.258819和cos(15度)= 0.965926得到
x-displacement = 800 sin(15 degrees) = 800 * 0.258819 = 207.055
y-displacement = 800 cos(15 degrees) = 800* 0.965926 = 772.741.
因此端点坐标为(400460.99 + 207.055,135836.76 + 772.741)=(400668.05,136609.49)。
以@whuber的答案为基础,如果您想在Python中实现此功能,则可以按照所述方法计算位移,然后将输出创建为点集合,如下所示:
import arcpy
from math import radians, sin, cos
origin_x, origin_y = (400460.99, 135836.7)
distance = 800
angle = 15 # in degrees
# calculate offsets with light trig
(disp_x, disp_y) = (distance * sin(radians(angle)),\
distance * cos(radians(angle)))
(end_x, end_y) = (origin_x + disp_x, origin_y + disp_y)
output = "offset-line.shp"
arcpy.CreateFeatureClass_management("c:\workspace", output, "Polyline")
cur = arcpy.InsertCursor(output)
lineArray = arcpy.Array()
# start point
start = arcpy.Point()
(start.ID, start.X, start.Y) = (1, origin_x, origin_y)
lineArray.add(start)
# end point
end = arcpy.Point()
(end.ID, end.X, end.Y) = (2, end_x, end_y)
lineArray.add(end)
# write our fancy feature to the shapefile
feat = cur.newRow()
feat.shape = lineArray
cur.insertRow(feat)
# yes, this shouldn't really be necessary...
lineArray.removeAll()
del cur