Projection of a point onto a closed convex

조회 수: 3 (최근 30일)
Donigo Fernando Sinaga
Donigo Fernando Sinaga 2018년 11월 18일
편집: Bruno Luong 2018년 11월 20일
I have a point P(50, 5000) and a curve (x.^2 - 2*x - 1) with x = [0:100]. How do I find the closest point on that curve to point P?
Thank you.

채택된 답변

Bruno Luong
Bruno Luong 2018년 11월 18일
편집: Bruno Luong 2018년 11월 18일
Q=[50;5000];
% Projection candidates on x.^2-2*x-y-1 = 0
P=ConicPrj(Q,[1 0; 0 0],[-2;-1],-1);
% Find the closest
[~,loc]=min(sum((P-Q).^2,1));
P=P(:,loc);
x=P(1)
y=P(2)
The projection is
x = 71.723733062992125
y = 4.999846418365362e+03
  댓글 수: 4
Donigo Fernando Sinaga
Donigo Fernando Sinaga 2018년 11월 20일
How to change my function to that ConicPrj function input? What is a, b, and c?
Bruno Luong
Bruno Luong 2018년 11월 20일
편집: Bruno Luong 2018년 11월 20일
as written in the H1 line of ConicPrj , the conic is implicit equation -I change x to v here to avoid confusion with your x
E = { v such that: v'*A*v + b'*v + c = 0}
In your case, if I define v := [x;y];
the equation of parabolic is
x^2- 2*x - y -1 = 0
Meaning
x*(1)*x + x*0*y + y*0*x + y*0*y + (-2)*x + (-1)*y -1 = 0
^ ^ ^ ^ ^ ^ ^
A(1,1) A(1,2) A(2,1) A(2,2) b(1) b(2) c
or equivalently
v' * [1 0; 0 0] * v + [-2; -1]'*v - 1 = 0;
Therefore
A=[1 0; 0 0]; b = [-2; -1]; and c = -1;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by