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.
我在 UIView 中有 2 个点,但由于 UIView 坐标系不是笛卡尔坐标系,我无法在这两点之间获得正确的直线方程。当我应用直线的笛卡尔斜率时,我不断得到 UIView 坐标系的错误斜率。也许我错误地应用了单位矩阵或使用了错误的单位矩阵。我也需要翻译点斜式方程吗?我不确定。任何帮助将不胜感激。
您是否因为 CG 坐标系在 iPhone 和 Mac OS 之间颠倒/镜像而得到错误的斜率?如果是这样,那么只需将斜率方程中的 dy 更改为 -dy 即可。