Intersection of two parabolas where one is vertex shifted

In summary: Neither of these is an equation -- no = in either.Are these equations?x2 + 138x + 317 = 0(x - 33.33167)2 + 2222 = 0If so, I would solve for x in the second equation, and substitute that value in the first equation.
  • #1
curiouschris
147
0
Not a homework question but this seems to be the appropriate place...

1. Homework Statement

I would like to be able to calculate the intersections of two parabola's which accounts for one or both of the parabola's being shifted along the x axis

I have written an excel vba function to do this and it all works fine as long as the parabola's are in the form of [itex]ax^2+bx+c[/itex]

If I try to use [itex]a(x-h)^2+bx+c[/itex] I get lost

I have included the VBA function so you can see my working out
Code:
Function QQInterceptX(a1, b1, c1, a2, b2, c2, pos)
' returns the x intercept
' y1=a1x^2+b1x+c1
' y2=a2x^2+b2x+c2
' when they intersect then the following is true
' a2x^2+b2x+c2=a1x^2+b1x+c1 as the y values are equivalent
' using algebra we get the following
' x=(a1x^2 - a2x^2) + (b1x - b2x) + (c1 - c2)
' x=(a1-a2)x^2 + (b1-b2)x + (c1-c2)
' we can then solve using the quadtratic formula
' x = (-(b1-b2) +/- sqrt((b1-b2)^2 - 4*(a1-a2)*(c1-c2)))/(2*(a1-a2))
' check for div by 0
If ((a1 - a2) <> 0) Then
' return the positive x intercept
  If (pos) Then
    QQInterceptX = (-(b1 - b2) + Sqr((b1 - b2) ^ 2 - 4 * (a1 - a2) * (c1 - c2))) / (2 * (a1 - a2))
  Else
    QQInterceptX = (-(b1 - b2) - Sqr((b1 - b2) ^ 2 - 4 * (a1 - a2) * (c1 - c2))) / (2 * (a1 - a2))
  End If
Else
  QQInterceptX = CVErr(xlErrNA)
End If

Homework Equations


An example is the following equations

[tex]x^2+138x+317[/tex]
[tex](x -33.33167)^2+2222[/tex]

3. The Attempt at a Solution

I have attempted to resolve this myself but find my fingers hovering over the keyboard and I am sure the look of a stunned mullet on my face.

My online searches have produced zilch examples of what I am trying to do.

Its the step to the quadratic formula that loses me.

The best I could do is the following but my div by zero test fails as it does not take into account x (which is not in the divisor) So I am guessing I can't use the quadratic formula but I am not sure what else to use...

[tex]x = (-(b1-b2) +/- sqrt((b1-b2)^2 - 4*(a1-a2)*(c1-c2)))/(2*(a1-a2)) + (h1-h2)[/tex]

Attribution
To get me to the point of creating the VBA function I used this resource
http://zonalandeducation.com/mmts/i...woParabollas1/intersectionOfTwoParabolas1.htm
 
Physics news on Phys.org
  • #2
curiouschris said:
Not a homework question but this seems to be the appropriate place...

1. Homework Statement

I would like to be able to calculate the intersections of two parabola's which accounts for one or both of the parabola's being shifted along the x axis

I have written an excel vba function to do this and it all works fine as long as the parabola's are in the form of [itex]ax^2+bx+c[/itex]

If I try to use [itex]a(x-h)^2+bx+c[/itex] I get lost

I have included the VBA function so you can see my working out
Code:
Function QQInterceptX(a1, b1, c1, a2, b2, c2, pos)
' returns the x intercept
' y1=a1x^2+b1x+c1
' y2=a2x^2+b2x+c2
' when they intersect then the following is true
' a2x^2+b2x+c2=a1x^2+b1x+c1 as the y values are equivalent
' using algebra we get the following
' x=(a1x^2 - a2x^2) + (b1x - b2x) + (c1 - c2)
' x=(a1-a2)x^2 + (b1-b2)x + (c1-c2)
' we can then solve using the quadtratic formula
' x = (-(b1-b2) +/- sqrt((b1-b2)^2 - 4*(a1-a2)*(c1-c2)))/(2*(a1-a2))
' check for div by 0
If ((a1 - a2) <> 0) Then
' return the positive x intercept
  If (pos) Then
    QQInterceptX = (-(b1 - b2) + Sqr((b1 - b2) ^ 2 - 4 * (a1 - a2) * (c1 - c2))) / (2 * (a1 - a2))
  Else
    QQInterceptX = (-(b1 - b2) - Sqr((b1 - b2) ^ 2 - 4 * (a1 - a2) * (c1 - c2))) / (2 * (a1 - a2))
  End If
Else
  QQInterceptX = CVErr(xlErrNA)
End If

Homework Equations


An example is the following equations

[tex]x^2+138x+317[/tex]
[tex](x -33.33167)^2+2222[/tex]
Neither of these is an equation -- no = in either.

Are these equations?
x2 + 138x + 317 = 0
(x - 33.33167)2 + 2222 = 0

If so, I would solve for x in the second equation, and substitute that value in the first equation.

curiouschris said:

3. The Attempt at a Solution

I have attempted to resolve this myself but find my fingers hovering over the keyboard and I am sure the look of a stunned mullet on my face.

My online searches have produced zilch examples of what I am trying to do.

Its the step to the quadratic formula that loses me.

The best I could do is the following but my div by zero test fails as it does not take into account x (which is not in the divisor) So I am guessing I can't use the quadratic formula but I am not sure what else to use...

[tex]x = (-(b1-b2) +/- sqrt((b1-b2)^2 - 4*(a1-a2)*(c1-c2)))/(2*(a1-a2)) + (h1-h2)[/tex]

Attribution
To get me to the point of creating the VBA function I used this resource
http://zonalandeducation.com/mmts/i...woParabollas1/intersectionOfTwoParabolas1.htm
 
  • #3
curiouschris said:
Not a homework question but this seems to be the appropriate place...

1. Homework Statement

I would like to be able to calculate the intersections of two parabola's which accounts for one or both of the parabola's being shifted along the x axis

I have written an excel vba function to do this and it all works fine as long as the parabola's are in the form of [itex]ax^2+bx+c[/itex]

If I try to use [itex]a(x-h)^2+bx+c[/itex] I get lost

Homework Equations


An example is the following equations

[tex]x^2+138x+317[/tex]
[tex](x -33.33167)^2+2222[/tex]

3. The Attempt at a Solution

I have attempted to resolve this myself but find my fingers hovering over the keyboard and I am sure the look of a stunned mullet on my face.

My online searches have produced zilch examples of what I am trying to do.

Its the step to the quadratic formula that loses me.

The best I could do is the following but my div by zero test fails as it does not take into account x (which is not in the divisor) So I am guessing I can't use the quadratic formula but I am not sure what else to use...

[tex]x = (-(b1-b2) +/- sqrt((b1-b2)^2 - 4*(a1-a2)*(c1-c2)))/(2*(a1-a2)) + (h1-h2)[/tex]

Attribution
To get me to the point of creating the VBA function I used this resource
http://zonalandeducation.com/mmts/i...woParabollas1/intersectionOfTwoParabolas1.htm

Either expand out ##a(x-h)^2 +bx+c## to ##ax^2 + (b - 2ah)x + (c+h^2) = ax^2 + Bx + C##, or else write ##a(x-h)^2 + bx + c## as ##a(x-h)^2 +b(x-h) + (c+bh)## and use ##x-h## as the variable in place of ##x##.
 
  • #4
Mark44 said:
Neither of these is an equation -- no = in either.

Are these equations?
x2 + 138x + 317 = 0
(x - 33.33167)2 + 2222 = 0
Yes you are correct I should have added [itex]=0[/itex]

Mark44 said:
If so, I would solve for x in the second equation, and substitute that value in the first equation.

Am I missing something? I don't see how that gives helps me find the intersection of the two parabola's
 
  • #5
Ray Vickson said:
Either expand out a(xh)2+bx+ca(x-h)^2 +bx+c to ax2+(b−2ah)x+(c+h2)=ax2+Bx+Cax^2 + (b - 2ah)x + (c+h^2) = ax^2 + Bx + C, or else write a(xh)2+bx+ca(x-h)^2 + bx + c as a(xh)2+b(xh)+(c+bh)a(x-h)^2 +b(x-h) + (c+bh) and use xhx-h as the variable in place of xx.

Ummm. Still thinking about this. not sure I follow. I will try and work it through a bit later.
 
  • #6
curiouschris said:

1. Homework Statement

I would like to be able to calculate the intersections of two parabola's which accounts for one or both of the parabola's being shifted along the x axis

I have written an excel vba function to do this and it all works fine as long as the parabola's are in the form of [itex]ax^2+bx+c[/itex]

If I try to use [itex]a(x-h)^2+bx+c[/itex] I get lost

Homework Equations


An example is the following equations

[tex]x^2+138x+317[/tex]
[tex](x -33.33167)^2+2222[/tex]

These are functions, and you can write that [tex]y=x^2+138x+317[/tex] and [tex](x -33.33167)^2+2222[/tex].
They intersect at a point (x,y ) which satisfies both equations. So you can write an equation for x by equating the y-s.
[tex]x^2+138x+317=(x -33.33167)^2+2222[/tex]. Expand the square at the right side, collect the terms of equal power of x, and solve.
 
  • #7
Mark44 said:
If so, I would solve for x in the second equation, and substitute that value in the first equation.

curiouschris said:
Am I missing something? I don't see how that gives helps me find the intersection of the two parabola's
You're looking for points (x, y) that satisfy both equations.

Looking at your second equation again, and more closely, you have this:
(x - 33.33167)2 + 2222 = 0

As it turns out, this equation has no real solutions, since (x - 33.33167)2 is always greater than or equal to zero. We can't add a nonnegative number to 2222 to get zero. Since you can't solve for x in this equation, my earlier suggestion is no help. What you have here is a parabola that opens up, and whose vertex (low point) is above the x-axis.
 
  • #8
You seem to still not understand the question posed. Where [itex](x - 33.33167)^2 + 2222 = 0[/itex] is irrelevant.

The question is to determine where the two parabolas, [itex]y= (x - 33.33167)^2 + 2222[/itex] and [itex]y= x^2 + 138x + 317[/itex].
The equation we need to solve is [itex] (x - 33.33167)^2 + 2222= x^2 + 138x + 317[/itex] as ehild said.

"Expanding" that first part is not all that difficult: [itex]x^2- 66.66334x+ 1111.0002249889+ 2222= x^2+ 138x+ 317[/itex].
 
  • #9
HallsOfIvy said:
You seem to still not understand the question posed. Where [itex](x - 33.33167)^2 + 2222 = 0[/itex] is irrelevant.
If this is directed to me, yes I understand that that equation is irrelevant. That's why I said that my earlier suggestion was no help.
 
  • #10
curiouschris said:
Yes you are correct I should have added [itex]=0[/itex]
Am I missing something? I don't see how that gives helps me find the intersection of the two parabola's

Suppose you want to find the intersection of ##f_1 =a x^2 + b x + c## and ##f_2 = a(x-h)^2 + r x + s##, with the exact some ##a## in both. In that case your algorithm is doomed to failure, because the equation ##f_1 = f_2## has only a single root. That is, when ##a_1 = a_2## your algorithm should not declare an error; rather, it should go to an alternative branch where a different calculation is performed to find the single point of intersection.

If ##a_1 \neq a_2## but ##|a_1 - a_2|## is very small, you could have a lot of trouble with numerical roundoff errors, so at least one of the two intersection points could be quite different from the value calculated by the algorithm as written. Basically, the issue is what happens to the two roots of ##f_1 - f_2 = Ax^2 + Bx + C = 0## when ##A \to 0##. The answer is that one of them remains stable, while the other one marches off to ##\pm \infty##, disappearing altogether when ##A = 0## exactly. When ##A## is numerically very close to 0 (but still finite), an ordinary application of the quadratic solution formula can be subject to fatal numerical errors, just due to finite wordlength arithmetic.
 
  • #11
Morning Guys

I lay in bed last night and made a mental note of my idiocy. My first attempt to write a formula was incorrect I had missed an important step. I will try again when I get a chance today

Mark44 said:
You're looking for points (x, y) that satisfy both equations.

Looking at your second equation again, and more closely, you have this:
(x - 33.33167)2 + 2222 = 0

As it turns out, this equation has no real solutions, since (x - 33.33167)2 is always greater than or equal to zero. We can't add a nonnegative number to 2222 to get zero. Since you can't solve for x in this equation, my earlier suggestion is no help. What you have here is a parabola that opens up, and whose vertex (low point) is above the x-axis.

Yes that's correct the vertex is positive and open up. this is a graph of the two equations (courtesy of wolframalpha)
http://www4b.wolframalpha.com/Calculate/MSP/MSP2011c5c18f5f7895224000034a5ii4f809i4h5e?MSPStoreType=image/gif&s=8&w=448.&h=191.&cdf=RangeControl

Ray Vickson said:
Suppose you want to find the intersection of f1=ax2+bx+cf_1 =a x^2 + b x + c and f2=a(xh)2+rx+sf_2 = a(x-h)^2 + r x + s, with the exact some aa in both. In that case your algorithm is doomed to failure, because the equation f1=f2f_1 = f_2 has only a single root. That is, when a1=a2a_1 = a_2 your algorithm should not declare an error; rather, it should go to an alternative branch where a different calculation is performed to find the single point of intersection.

Thanks. I was reading the quadratics page on wikipedia on the bus this morning and realized this error. So I was pleased when you noted it because it could have caused me issues. I assumed that if the discriminant was zero then there was no solution. I will create a branch to correct for this error.

At the same time I read about the possibility of inaccuracies. I don't think this is an issue for me in what I am doing but the samples I am using are a very small subset of possible equations so I will need to check into this further.
 
Last edited by a moderator:

What is the intersection point of two parabolas where one is vertex shifted?

The intersection point of two parabolas where one is vertex shifted is the point where the two parabolas intersect each other. It is the solution to the system of equations formed by the two parabolas.

How do you find the intersection point of two parabolas where one is vertex shifted?

To find the intersection point of two parabolas where one is vertex shifted, you can set the two parabolas equal to each other and solve for the variables. This will give you the coordinates of the intersection point.

What does the intersection point represent?

The intersection point represents the common solution to the two parabolas. It is the point where the two parabolas have the same x and y values, and therefore, they intersect.

Can there be more than one intersection point between two parabolas where one is vertex shifted?

Yes, there can be more than one intersection point between two parabolas where one is vertex shifted. This will occur when the two parabolas have multiple common solutions, resulting in multiple intersection points.

What are some real-life applications of finding the intersection point of two parabolas where one is vertex shifted?

One real-life application of finding the intersection point of two parabolas where one is vertex shifted is in physics, specifically in projectile motion. The intersection point represents the maximum height reached by the object in motion.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
14
Views
2K
  • Precalculus Mathematics Homework Help
Replies
3
Views
5K
  • General Math
Replies
5
Views
1K
  • Thermodynamics
Replies
1
Views
3K
  • Calculus and Beyond Homework Help
Replies
17
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
930
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Precalculus Mathematics Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
Back
Top