垂直于给定线的绘制线 [英] Drawing line perpendicular to a given line

查看:159
本文介绍了垂直于给定线的绘制线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一行的开始和结束坐标。我想要绘制另一行贴在这个结束,这样,他们将彼此垂直。

I have start and end coordinate of a line. I want to drawn another line sticking at the end of this this such that they will be perpendicular to each other.

我试图这样做使用正常的几何。

I am trying to do this using the normal geometry. Is there any high-level API there in MFC for the same.

感谢

推荐答案

如果(dx,dy)是给定线的x和y坐标的差异,则可以通过设计其坐标差为(-dy,dx)使另一条线垂直。您可以通过任何因子(-c * dy,c * dx)缩放以更改其长度。

If (dx,dy) are the differences in the x and y coodinates of the given line, you can make another line perpendicular by contriving for the differences in its coordinates to be (-dy, dx). You can scale that by any factor (-c*dy, c*dx) to change its length.

这篇关于垂直于给定线的绘制线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆