如何计算两条线是面向还是背向?

发布于 2024-12-20 21:48:17 字数 227 浏览 5 评论 0原文

给定描述 2 条线的 4 个点,如何快速计算出线 A 是面向还是背向线 B?

在此处输入图像描述


同样,如何检查直线 A 是否朝向或远离二次贝塞尔曲线 B?

在此处输入图像描述

Given the 4 points describing 2 lines, how do you quickly calculate if line A is facing towards or away from line B?

enter image description here


Similarly, how to check if line A is towards or away from quadratic bezier curve B?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

树深时见影 2024-12-27 21:48:17

取候选线的单位向量和指向另一条线的单位法线的点积(有两个单位法线向量)。

如果点积为正,则“远离”; “向”是消极的。

如果您不知道向量,请获取介绍文本并阅读它们。

Take the dot product of the unit vector of the candidate line and the unit normal pointing in the direction you wish for the other (there are two unit normal vectors).

If the dot product is positive, it's "away"; "towards" is negative.

If you don't know vectors, get an intro text and read up on them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文