Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何计算点以绘制 2 条平行线。
我知道平行线中心的起点和终点。为了让事情变得更难,它需要支持直线和贝塞尔曲线。
这个问题很模糊,但这是一种可能性。希望有帮助。
对于一个段 (x1,y1)-(x2,y2),您可以计算另一个段,沿角度 a 表示的方向 n 像素以外的这种方式
x1b = x1 + n cos a y1b = y1 - n sin a x2b = x2 + n cos a y2b = y2 - n sin a