作者Leon (Achilles)
站内Prob_Solve
标题Re: [问题] 面试问到的问题...
时间Thu Dec 13 15:48:18 2012
※ 引述《Leon (Achilles)》之铭言:
: : 接着说明一下直线截成线段的问题。
: : 对偶的时候,点(a,b)对偶成直线y=ax+b。
: : 考虑两个直线的交点,也就是两条直线解联立方程式。
: : 根据公式解,交点的座标范围一定会在 |a|*|b|+|c|*|d| 之内。
:
: First, I don't understant your notation.
: What do you mean by the range |a|*|b|+|c|*|d| ?
:
: It seems not a range in 2D ?
:
:
: And I have the same question for you.
:
: Assume you have N lines, based on your description
: You claim there is a range for the intersection.
:
: Then, how many operations you need to calculate the range?
:
:
: --
:
※ 发信站: 批踢踢实业坊(ptt.cc)
: ◆ From: 142.136.127.136
: 推 DJWS:(1) 我指的是 Cramer's rule 那些系数 12/13 15:39
: → DJWS:(2) N个顶点对偶成直线, N条直线各自截成N条线段 ---> O(N) 12/13 15:40
: → DJWS:另外我是假设座标都是整数 如果座标-1<0<1那麽范围就会更大 12/13 15:41
OK, I really doubt your writing..
Linear algebra 001, high school algebra
intersection of two lines.
y = ax + b ;
y = cx + d ;
ax + b = cx + d ;
(a-c)x = d - b ;
x = (d-b) / (a-c) ;
Now, please tell me how it is related to your |a|*|b|+|c|*|d|
from Cramer's rule?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 142.136.127.136
1F:推 DJWS:恩 你说的没错 那麽范围最大到 |d|+|b| 才对 12/13 15:51
2F:→ Leon:you are wrong again, look, there is (a-c) term! 12/13 15:53
3F:推 DJWS:恩 你说的没错 除非abcd都是整数 范围才是 |d|+|b| 12/13 15:55
4F:→ Leon:then revise your post. Everyone should be responsible to 12/13 15:56
5F:→ Leon:what they write 12/13 15:57
6F:推 DJWS:这是当然 XD 12/13 15:59
7F:→ Leon:OK, your first statement is wrong. Now you can answer 12/14 01:24
8F:→ Leon:the second question: 12/14 03:05