ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 27 Aug 2019 13:50:46 +0200How can I solve line equation in SageMath?https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/So we know we got standard 2D line equation that looks like `y=a*x+b`. And now I want to solve the `a,b` by given a few points. How can I achieve it?
I remember I've seen the solution somewhere, but I just can't find it out now. Tue, 27 Aug 2019 03:53:01 +0200https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/Comment by Emmanuel Charpentier for <p>So we know we got standard 2D line equation that looks like <code>y=a*x+b</code>. And now I want to solve the <code>a,b</code> by given a few points. How can I achieve it?</p>
<p>I remember I've seen the solution somewhere, but I just can't find it out now. </p>
https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/?comment=47616#post-id-47616Homework ?Tue, 27 Aug 2019 13:49:34 +0200https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/?comment=47616#post-id-47616Answer by tmonteil for <p>So we know we got standard 2D line equation that looks like <code>y=a*x+b</code>. And now I want to solve the <code>a,b</code> by given a few points. How can I achieve it?</p>
<p>I remember I've seen the solution somewhere, but I just can't find it out now. </p>
https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/?answer=47607#post-id-47607Let me just restate your question in a way that makes the answer obvious : if `(x_0, y_0)` and `(x_1, y_1)` are two of the few given points, you want to solve the system of equations `y_0==a*x_0+b` and `y_1==a*x_1+b`, where `a` and `b` are the unknown.Tue, 27 Aug 2019 09:18:12 +0200https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/?answer=47607#post-id-47607Comment by Emmanuel Charpentier for <p>Let me just restate your question in a way that makes the answer obvious : if <code>(x_0, y_0)</code> and <code>(x_1, y_1)</code> are two of the few given points, you want to solve the system of equations <code>y_0==a*x_0+b</code> and <code>y_1==a*x_1+b</code>, where <code>a</code> and <code>b</code> are the unknown.</p>
https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/?comment=47617#post-id-47617The "given a few points" proposition is a red flag...Tue, 27 Aug 2019 13:50:46 +0200https://ask.sagemath.org/question/47606/how-can-i-solve-line-equation-in-sagemath/?comment=47617#post-id-47617