필터 지우기
필터 지우기

How to draw parabola given two points A(x1,y1) & B(x2,y2)?

조회 수: 9 (최근 30일)
Shree
Shree 2015년 3월 5일
댓글: Shree 2015년 3월 5일
Hello, I need to draw the parabola and I have two points First: A(1.2643, 5.6106) Last: B(120, 45).
I have tried varies formulas but the graph is not correct. Specially some formulas assume b=0 in the general parabola formula y = ax^2 + bx + c but in my case it is not zero.
Please tell me how to do it for this specific example.

채택된 답변

Torsten
Torsten 2015년 3월 5일
Parabola: p(x)=ax^2+bx+c
tan(50°)=p'(x1)=2*a*1.2643+b
5.6106=p(x1)=a*1.2643^2+b*1.2643+c
45=p(x2)=a*120^2+b*120+c
This is a linear system of equations in a,b,c and can be solved by
x=[2*1.2643 1 0; 1.2643^2 1.2643 1; 120^2 120 1]\[tand(50);5.6106;45]; %x(1)=a, x(2)=b, x(3)=c
Best wishes
Torsten.

추가 답변 (1개)

Star Strider
Star Strider 2015년 3월 5일
Two points can define a line, but you need at least three to uniquely describe a parabola.
Infinitely many parabolas can be drawn through only two points.
  댓글 수: 2
John D'Errico
John D'Errico 2015년 3월 5일
편집: John D'Errico 2015년 3월 5일
And it takes 3 DISTINCT points to define a parabola. :) +1 anyway
Shree
Shree 2015년 3월 5일
I have angle of 50 deg at the starting point with reference to x axis(from tangent of parabola), will that help to get the parabola. Is there any way to do it with these three inputs?

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

카테고리

Help CenterFile Exchange에서 Discrete Math에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by