|
|
第 1 帖 | |
|
|
标题: how to find a line which is perpendicular to a given line programmaticlly ??? Say, I have a line A :
y = a * x + b now I want to find another line which is perpendicular to A at point M [m, n] and M is on A: y1 = a1 * x1 + b1 what is the simplest way to do it programmatically in c++???
__________________
淡泊以明志,宁静以致远 |
|
|
|
|
|
|
|
第 2 帖 | |
|
|
a1=-1/a (a!=0)
|
|
|
|
|
|
|
|
第 3 帖 | |
|
|
用lex && yacc 来分析:
y = a * x + b var_0 = var_1 times var_2 plus var_3 得到syntax tree以后,遍历找相似的。 |
|
|
|
|
|
|
|
第 4 帖 | |
|
|
楼主问的是语法分析的问题么?难道我理解错了?
perpendicular不是垂直的意思么? |
|
|
|
|
|