Re: [問題] 面試問到的問題...

看板Prob_Solve (計算數學 Problem Solving)作者 (Achilles)時間12年前 (2012/12/13 15:48), 編輯推噓3(305)
留言8則, 2人參與, 最新討論串8/8 (看更多)
※ 引述《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

12/13 15:51, , 1F
恩 你說的沒錯 那麼範圍最大到 |d|+|b| 才對
12/13 15:51, 1F

12/13 15:53, , 2F
you are wrong again, look, there is (a-c) term!
12/13 15:53, 2F

12/13 15:55, , 3F
恩 你說的沒錯 除非abcd都是整數 範圍才是 |d|+|b|
12/13 15:55, 3F

12/13 15:56, , 4F
then revise your post. Everyone should be responsible to
12/13 15:56, 4F

12/13 15:57, , 5F
what they write
12/13 15:57, 5F

12/13 15:59, , 6F
這是當然 XD
12/13 15:59, 6F

12/14 01:24, , 7F
OK, your first statement is wrong. Now you can answer
12/14 01:24, 7F

12/14 03:05, , 8F
the second question:
12/14 03:05, 8F
文章代碼(AID): #1GoOX4FD (Prob_Solve)
文章代碼(AID): #1GoOX4FD (Prob_Solve)