这是您要找的东西吗?
startX = x;startY = y;endX = x + 40 * Math.sin(angle);endY = y + 40 * Math.cos(angle);
并在所使用的任何API中从(startX,startY)到(endX,endY)画一条线。
另请注意,
angle以弧度为单位。如果以度为单位,则需要先进行转换:
angle = angle * Math.PI / 180;

这是您要找的东西吗?
startX = x;startY = y;endX = x + 40 * Math.sin(angle);endY = y + 40 * Math.cos(angle);
并在所使用的任何API中从(startX,startY)到(endX,endY)画一条线。
另请注意,
angle以弧度为单位。如果以度为单位,则需要先进行转换:
angle = angle * Math.PI / 180;