How to linearize the distance formula?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












So I have an equation that contains the distance formula squared. However, I am interested in linearizing this equation.



My equation is:
Constant/distance squared



My distance is between a fixed point and a variable point. So x1 and y1 are known but x2 and y2 are variables. Any idea how to linearize this? I thought of expanding the distance and then linearizing the squares.







share|cite|improve this question




















  • Sometimes a different metric is used, such as the Manhattan distance. With just absolute values, this can be used without much problems in an LP solver.
    – Erwin Kalvelagen
    Aug 31 at 20:10














up vote
1
down vote

favorite












So I have an equation that contains the distance formula squared. However, I am interested in linearizing this equation.



My equation is:
Constant/distance squared



My distance is between a fixed point and a variable point. So x1 and y1 are known but x2 and y2 are variables. Any idea how to linearize this? I thought of expanding the distance and then linearizing the squares.







share|cite|improve this question




















  • Sometimes a different metric is used, such as the Manhattan distance. With just absolute values, this can be used without much problems in an LP solver.
    – Erwin Kalvelagen
    Aug 31 at 20:10












up vote
1
down vote

favorite









up vote
1
down vote

favorite











So I have an equation that contains the distance formula squared. However, I am interested in linearizing this equation.



My equation is:
Constant/distance squared



My distance is between a fixed point and a variable point. So x1 and y1 are known but x2 and y2 are variables. Any idea how to linearize this? I thought of expanding the distance and then linearizing the squares.







share|cite|improve this question












So I have an equation that contains the distance formula squared. However, I am interested in linearizing this equation.



My equation is:
Constant/distance squared



My distance is between a fixed point and a variable point. So x1 and y1 are known but x2 and y2 are variables. Any idea how to linearize this? I thought of expanding the distance and then linearizing the squares.









share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Aug 29 at 10:00









kaki no

61




61











  • Sometimes a different metric is used, such as the Manhattan distance. With just absolute values, this can be used without much problems in an LP solver.
    – Erwin Kalvelagen
    Aug 31 at 20:10
















  • Sometimes a different metric is used, such as the Manhattan distance. With just absolute values, this can be used without much problems in an LP solver.
    – Erwin Kalvelagen
    Aug 31 at 20:10















Sometimes a different metric is used, such as the Manhattan distance. With just absolute values, this can be used without much problems in an LP solver.
– Erwin Kalvelagen
Aug 31 at 20:10




Sometimes a different metric is used, such as the Manhattan distance. With just absolute values, this can be used without much problems in an LP solver.
– Erwin Kalvelagen
Aug 31 at 20:10










1 Answer
1






active

oldest

votes

















up vote
0
down vote













From the Taylor development,



$$sqrt(x_2+delta x-x_1)^2+(y_2+delta y-y_1)^2approx
\sqrt(x_2-x_1)^2+(y_2-y_1)^2+fracdelta x(x_2-x_1)+delta y(y_2-y_1)sqrt(x_2-x_1)^2+(y_2-y_1)^2.$$



which is linear in $delta x, delta y$, the variations around some "central" $x_2,y_2$.



Notice that this gives you the algebraic distance to the plane tangent on the sphere centered at $p_1$, and passing through $p_2$.




You can reason similarly for the case of $dfrac cd^2$.






share|cite|improve this answer






















  • Thank you for your answer!! Unfortunately, I did not get your idea very well. I have the following C/(x1-x2)^2 + (y1-y2)^2 > B , B and C are constants a x2nd I know x1 and y1. x2 and y2 are variables. However, I need to linearize this inquality. How can I do this? Many thanks!!
    – kaki no
    Aug 29 at 10:24










  • @kakino: I missed that you were after $c/d^2$. Use Taylor like I did for $d$.
    – Yves Daoust
    Aug 29 at 10:25











  • Can you please provide a link that explains that or any other information as I did not fully understand. Really thanks for the help!!
    – kaki no
    Aug 29 at 10:26










  • @kakino math.stackexchange.com/q/67896/65203
    – Yves Daoust
    Aug 29 at 10:38










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2898181%2fhow-to-linearize-the-distance-formula%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













From the Taylor development,



$$sqrt(x_2+delta x-x_1)^2+(y_2+delta y-y_1)^2approx
\sqrt(x_2-x_1)^2+(y_2-y_1)^2+fracdelta x(x_2-x_1)+delta y(y_2-y_1)sqrt(x_2-x_1)^2+(y_2-y_1)^2.$$



which is linear in $delta x, delta y$, the variations around some "central" $x_2,y_2$.



Notice that this gives you the algebraic distance to the plane tangent on the sphere centered at $p_1$, and passing through $p_2$.




You can reason similarly for the case of $dfrac cd^2$.






share|cite|improve this answer






















  • Thank you for your answer!! Unfortunately, I did not get your idea very well. I have the following C/(x1-x2)^2 + (y1-y2)^2 > B , B and C are constants a x2nd I know x1 and y1. x2 and y2 are variables. However, I need to linearize this inquality. How can I do this? Many thanks!!
    – kaki no
    Aug 29 at 10:24










  • @kakino: I missed that you were after $c/d^2$. Use Taylor like I did for $d$.
    – Yves Daoust
    Aug 29 at 10:25











  • Can you please provide a link that explains that or any other information as I did not fully understand. Really thanks for the help!!
    – kaki no
    Aug 29 at 10:26










  • @kakino math.stackexchange.com/q/67896/65203
    – Yves Daoust
    Aug 29 at 10:38














up vote
0
down vote













From the Taylor development,



$$sqrt(x_2+delta x-x_1)^2+(y_2+delta y-y_1)^2approx
\sqrt(x_2-x_1)^2+(y_2-y_1)^2+fracdelta x(x_2-x_1)+delta y(y_2-y_1)sqrt(x_2-x_1)^2+(y_2-y_1)^2.$$



which is linear in $delta x, delta y$, the variations around some "central" $x_2,y_2$.



Notice that this gives you the algebraic distance to the plane tangent on the sphere centered at $p_1$, and passing through $p_2$.




You can reason similarly for the case of $dfrac cd^2$.






share|cite|improve this answer






















  • Thank you for your answer!! Unfortunately, I did not get your idea very well. I have the following C/(x1-x2)^2 + (y1-y2)^2 > B , B and C are constants a x2nd I know x1 and y1. x2 and y2 are variables. However, I need to linearize this inquality. How can I do this? Many thanks!!
    – kaki no
    Aug 29 at 10:24










  • @kakino: I missed that you were after $c/d^2$. Use Taylor like I did for $d$.
    – Yves Daoust
    Aug 29 at 10:25











  • Can you please provide a link that explains that or any other information as I did not fully understand. Really thanks for the help!!
    – kaki no
    Aug 29 at 10:26










  • @kakino math.stackexchange.com/q/67896/65203
    – Yves Daoust
    Aug 29 at 10:38












up vote
0
down vote










up vote
0
down vote









From the Taylor development,



$$sqrt(x_2+delta x-x_1)^2+(y_2+delta y-y_1)^2approx
\sqrt(x_2-x_1)^2+(y_2-y_1)^2+fracdelta x(x_2-x_1)+delta y(y_2-y_1)sqrt(x_2-x_1)^2+(y_2-y_1)^2.$$



which is linear in $delta x, delta y$, the variations around some "central" $x_2,y_2$.



Notice that this gives you the algebraic distance to the plane tangent on the sphere centered at $p_1$, and passing through $p_2$.




You can reason similarly for the case of $dfrac cd^2$.






share|cite|improve this answer














From the Taylor development,



$$sqrt(x_2+delta x-x_1)^2+(y_2+delta y-y_1)^2approx
\sqrt(x_2-x_1)^2+(y_2-y_1)^2+fracdelta x(x_2-x_1)+delta y(y_2-y_1)sqrt(x_2-x_1)^2+(y_2-y_1)^2.$$



which is linear in $delta x, delta y$, the variations around some "central" $x_2,y_2$.



Notice that this gives you the algebraic distance to the plane tangent on the sphere centered at $p_1$, and passing through $p_2$.




You can reason similarly for the case of $dfrac cd^2$.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Aug 29 at 10:24

























answered Aug 29 at 10:11









Yves Daoust

114k665208




114k665208











  • Thank you for your answer!! Unfortunately, I did not get your idea very well. I have the following C/(x1-x2)^2 + (y1-y2)^2 > B , B and C are constants a x2nd I know x1 and y1. x2 and y2 are variables. However, I need to linearize this inquality. How can I do this? Many thanks!!
    – kaki no
    Aug 29 at 10:24










  • @kakino: I missed that you were after $c/d^2$. Use Taylor like I did for $d$.
    – Yves Daoust
    Aug 29 at 10:25











  • Can you please provide a link that explains that or any other information as I did not fully understand. Really thanks for the help!!
    – kaki no
    Aug 29 at 10:26










  • @kakino math.stackexchange.com/q/67896/65203
    – Yves Daoust
    Aug 29 at 10:38
















  • Thank you for your answer!! Unfortunately, I did not get your idea very well. I have the following C/(x1-x2)^2 + (y1-y2)^2 > B , B and C are constants a x2nd I know x1 and y1. x2 and y2 are variables. However, I need to linearize this inquality. How can I do this? Many thanks!!
    – kaki no
    Aug 29 at 10:24










  • @kakino: I missed that you were after $c/d^2$. Use Taylor like I did for $d$.
    – Yves Daoust
    Aug 29 at 10:25











  • Can you please provide a link that explains that or any other information as I did not fully understand. Really thanks for the help!!
    – kaki no
    Aug 29 at 10:26










  • @kakino math.stackexchange.com/q/67896/65203
    – Yves Daoust
    Aug 29 at 10:38















Thank you for your answer!! Unfortunately, I did not get your idea very well. I have the following C/(x1-x2)^2 + (y1-y2)^2 > B , B and C are constants a x2nd I know x1 and y1. x2 and y2 are variables. However, I need to linearize this inquality. How can I do this? Many thanks!!
– kaki no
Aug 29 at 10:24




Thank you for your answer!! Unfortunately, I did not get your idea very well. I have the following C/(x1-x2)^2 + (y1-y2)^2 > B , B and C are constants a x2nd I know x1 and y1. x2 and y2 are variables. However, I need to linearize this inquality. How can I do this? Many thanks!!
– kaki no
Aug 29 at 10:24












@kakino: I missed that you were after $c/d^2$. Use Taylor like I did for $d$.
– Yves Daoust
Aug 29 at 10:25





@kakino: I missed that you were after $c/d^2$. Use Taylor like I did for $d$.
– Yves Daoust
Aug 29 at 10:25













Can you please provide a link that explains that or any other information as I did not fully understand. Really thanks for the help!!
– kaki no
Aug 29 at 10:26




Can you please provide a link that explains that or any other information as I did not fully understand. Really thanks for the help!!
– kaki no
Aug 29 at 10:26












@kakino math.stackexchange.com/q/67896/65203
– Yves Daoust
Aug 29 at 10:38




@kakino math.stackexchange.com/q/67896/65203
– Yves Daoust
Aug 29 at 10:38

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2898181%2fhow-to-linearize-the-distance-formula%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Mutual Information Always Non-negative

Why am i infinitely getting the same tweet with the Twitter Search API?