필터 지우기
필터 지우기

solving parabola with x and y intercept

조회 수: 2 (최근 30일)
Jarrod
Jarrod 2023년 10월 3일
답변: Jarrod 2023년 10월 3일
Im currently trying figure out how to graph a parabola given x and y intercept
function y = parshelter(x1,y1,x2,y2)
%where i need help%
end
---im trying to call it from another code ---
xstart=0
ystart=24
xend=10
yend=0
parshelter(xstart,ystart,xend,yend)
any help would be nice as ive been trying for hours now
(xstart,ystart) is the y intercept and (xend,yend) is a x intercept
  댓글 수: 2
John D'Errico
John D'Errico 2023년 10월 3일
편집: John D'Errico 2023년 10월 3일
You can't. If you are asking what I think you are...
There are infinitely many parabola that pass through two points, an x-intercept, and a y-intercept. There is no unique solution.
If you want a unique solution, then a straight line will pass through the two points, AND a straight line is just a parabola with a zero quadratic coefficient. Think of the straight line as the simplest possible parabola, or if you prefer, a degenerate parabola.
Jarrod
Jarrod 2023년 10월 3일
(xstart,ystart) is the vertex does that help

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

채택된 답변

Jarrod
Jarrod 2023년 10월 3일
function y = parshelter(x1,y1,x2,y2)
syms x
b=(( y2 - y1 )/( (x1^2) - (x2^2) ));
a=y1+b*x1^2;
y=a-b*x^2;
end
this does end up working from what i can tell

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by