Daedalus 329 Posted November 19, 2013 (edited) For this challenge, I've decided to go with the parabola yet again. If we take a triangle, it is possible to find three parabolic curves that fit perfectly inside the triangle such that two vertices of the triangle are located on a parabola with two sides of the triangle being tangent to the parabola at those points. The following image illustrates this property: The above image demonstrates these parabolic curves that fit perfectly in the triangle. Of course, the equation that describes the parabolas is not a standard function and is defined parametrically. Furthermore, the order of the points matter, which determines the parabolic curve and direction along the path. The goal of this challenge is to find the parametric equation that describes the parabolic curves that fit inside a triangle specified by the vertices [math]P_0=(x_0, y_0)[/math], [math]P_1=(x_1, y_1)[/math], and [math]P_2=(x_2, y_2)[/math]. Edited November 19, 2013 by Daedalus 3 Share this post Link to post Share on other sites

Daedalus 329 Posted November 21, 2013 (edited) I appreciate the rep points, but is anyone interested in trying to solve the challenge? I do realize that it may seem complicated, but the answer can be derived using a few concepts from Calculus 1 and algebra. Edited November 21, 2013 by Daedalus 0 Share this post Link to post Share on other sites

moth 128 Posted November 21, 2013 This seems like one I should be able to solve but I'm unsure if the antiderivative will give me the right function to parametrize. 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 21, 2013 (edited) This seems like one I should be able to solve but I'm unsure if the antiderivative will give me the right function to parametrize. I think you are heading in the wrong direction. Look further into what is going on in the problem. We clearly have two sides of the triangle that are tangent to the parabolic curve. To give you a hint, I had to use a limit. However, I didn't use the derivative directly. Instead, I used the tangents with a method I developed to solve this problem : ) I've never heard of anyone using this method before, but that doesn't mean it is new. Regardless, It's actually a pretty cool way to derive the parametric equation. Edited November 21, 2013 by Daedalus 0 Share this post Link to post Share on other sites

moth 128 Posted November 22, 2013 Well, I'm stumped.I was hoping to use the slope of the tangent ( m ) with y = mx + Constant to get the derivative of the parabola at (x,y). Right now I'm trying to get Python to plot it in matplotlibbut mostly just reading the documentation for matplotlib. I'm looking forward to seeing your solution. 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 22, 2013 (edited) Well, I'm stumped.I was hoping to use the slope of the tangent ( m ) with y = mx + Constant to get the derivative of the parabola at (x,y). Right now I'm trying to get Python to plot it in matplotlib but mostly just reading the documentation for matplotlib. I'm looking forward to seeing your solution. Now you are getting on the right track, and you already have two lines that are tangent to the parabolic curve. You should explore that method and see what you discover. Here, this should help you along: Point-Slope Linear Form [math]y-y_1=m(x-x_1)[/math] or [math]y=m(x-x_1)+y_1[/math] Edited November 22, 2013 by Daedalus 0 Share this post Link to post Share on other sites

Endercreeper01 47 Posted November 22, 2013 Can we assume that P_{0}=-P_{2}? 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 23, 2013 (edited) Can we assume that P_{0}=-P_{2}? It has to work for any triangle, but it can help to work with a simple triangle to solve the problem. To give you all another hint, I solved the problem much like one would do for approximating an integral or for arc length. Hence, the use of the limit. Edited November 23, 2013 by Daedalus 0 Share this post Link to post Share on other sites

moth 128 Posted November 23, 2013 Had some time this morning to get a clue about matplotlib.Once we know the derivative, can't we find the antiderivative at a point on the parabola to get the equation? I'm unsure about integrals. 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 24, 2013 Had some time this morning to get a clue about matplotlib. Once we know the derivative, can't we find the antiderivative at a point on the parabola to get the equation? I'm unsure about integrals. I didn't use the derivative directly. Think about the other properties that tangent lines have besides being tangent to the curve. In other words, how can we use tangent lines to derive the parametric equation without using the derivative directly. 0 Share this post Link to post Share on other sites

Endercreeper01 47 Posted November 24, 2013 Do we get a prize? 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 24, 2013 (edited) Do we get a prize? I will give you rep and 5 stars 1 additional star if you can solve the problem, and you might get rep and stars from other people too. However, the biggest prize is the knowledge and satisfaction that you gain from working the problem and finding the solution, which is why I post these challenges. Of course, it also allows me to share problems that I have solved in a fun way instead of just posting a bunch of equations. Edit: Perhaps five stars is a little too much for solving one problem. I'll give you an extra star for each challenge that you win. By the time you have completed five challenges, you will have a vote of five stars and five points of rep from me. I realize it isn't much of a prize, but it's the best I can do. If I could offer more rep for solving certain challenges, I would. At least you will have gained some knowledge and bragging rights for being the first person to solve each challenge. Edited November 24, 2013 by Daedalus 0 Share this post Link to post Share on other sites

moth 128 Posted November 26, 2013 //I can get pretty close with linear approximation, but I don't know how to say it in Math.#include "stdio.h"//f(x) = f(a) + f'(a)(x - a)int main(int argc, char *argv[]){float X = -2; //startpoint a=(-2,0)float slope = -2; //f'(a)float Y =0; //f(a)float dx=0.01; //intervalprintf("%f\n",Y);for(X=-2;X<=2;X+=dx){Y = Y + slope*X*dx;printf("%f\n",Y);}return 0;} Thanks for another enlightening challenge! 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 26, 2013 (edited) Thanks for another enlightening challenge! You're welcome. At risk of giving the solution away, I'm going to give you one last hint. You have 2 vertices of the triangle that are also points on the parabola. You also have two sides of the triangle that are tangent to the parabola at those 2 vertices. Now, you have the third vertex of the triangle that has nothing to do with the parabolic curve. The only thing this third point has in common with the parabola is that it is also where both tangent lines intersect. I have now given you most of the information needed to solve the challenge. If you read the thread carefully, you should be able to use this hint to figure out how to find the solution. If no one replies to the thread asking for more time by tomorrow, I will go ahead and post the solution. Edited November 26, 2013 by Daedalus 0 Share this post Link to post Share on other sites

Endercreeper01 47 Posted November 27, 2013 Can we have more time? 0 Share this post Link to post Share on other sites

John Cuthber 3712 Posted November 27, 2013 Odd as it may seem I was trying to solve a similar problem at work a while ago. I was trying to predict the melting points of mixtures of 2 materials, given very little starting data. What I had was the melting points of the 2 materials and their cryoscopic constants. Here is the world's worst diagram Anyway, I had the gradients at the two extremes of the range and I had the values at those ends too. I ended up fitting a cubic equation to the data because a quadratic wouldn't fit. I was then able to estimate the melting points of the mixtures in between. the point is that I couldn't get a quadratic to work- there was "too much" data. So, I suspect that the answer to the question is no. I can draw a parabola through a point with a given gradient at that point and which passes through a second point, but I have run out of variables to decide what the gradient will be at that second point. I think you would need to use cubics, rather than parabolae. 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 27, 2013 (edited) Can we have more time? You sure can. I'll give you till Dec 2, 2013. Odd as it may seem I was trying to solve a similar problem at work a while ago. I was trying to predict the melting points of mixtures of 2 materials, given very little starting data. What I had was the melting points of the 2 materials and their cryoscopic constants. Here is the world's worst diagram Anyway, I had the gradients at the two extremes of the range and I had the values at those ends too. I ended up fitting a cubic equation to the data because a quadratic wouldn't fit. I was then able to estimate the melting points of the mixtures in between. the point is that I couldn't get a quadratic to work- there was "too much" data. So, I suspect that the answer to the question is no. I can draw a parabola through a point with a given gradient at that point and which passes through a second point, but I have run out of variables to decide what the gradient will be at that second point. I think you would need to use cubics, rather than parabolae. This particular problem actually results in a parabola. There is a very interesting property that tangent lines to parabolas have that make it possible to solve this one. Edited November 27, 2013 by Daedalus 0 Share this post Link to post Share on other sites

Endercreeper01 47 Posted November 27, 2013 Is it -| x * 3^{1/2} * | x |^{1/2} * ( 1 / x_{2})^{1/2} | / 2 + 1.25^{1/2}/2, where |x| represents the absolute value, and assuming x_{0 }= - x_{2}? 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 28, 2013 Is it -| x * 3^{1/2} * | x |^{1/2} * ( 1 / x_{2})^{1/2} | / 2 + 1.25^{1/2}/2, where |x| represents the absolute value, and assuming x_{0 }= - x_{2}? No, the actual solution is in parametric form where you have an equation for [math]x[/math] and one for [math]y[/math]. An example would be: [math]F_x(t)=t[/math] [math]F_y(t)=t^2[/math] Remember, the equation uses all three vertices of the triangle to define the parabolic curves, and the order of the points determine the curve (there are three) and direction along the path. 0 Share this post Link to post Share on other sites

John Cuthber 3712 Posted November 28, 2013 Perhaps I need someone to shine a searchlight on this problem for me. 0 Share this post Link to post Share on other sites

Daedalus 329 Posted November 29, 2013 (edited) After speaking with Endercreeper01, he's decided to go ahead and let me post the solution lol... Deriving the Solution In order to solve this challenge, we'll need to partition two sides of the triangle into [math]n[/math] segments. We also have to account for direction. So, if we consider that an object moves along the curve from the point [math]P_0[/math] towards [math]P_1[/math] ending at [math]P_2[/math], then the first side, U, starts at [math](x_0,y_0)[/math] and ends at [math](x_1,y_1)[/math] and the other side, V, at [math](x_1,y_1)[/math] to [math](x_2,y_2)[/math]. This allows us to define the following parametric equations that describe the points along the specified sides of the triangle in terms of our parameter [math]t[/math] where [math]\{t \in \mathbb{N} : 0\le t\le n\}[/math].[math]\text{U}_x(t)=x_0+(x_1-x_0)\,\frac{t}{n}[/math][math]\text{U}_y(t)=y_0+(y_1-y_0)\,\frac{t}{n}[/math][math]\text{V}_x(t)=x_1+(x_2-x_1)\,\frac{t}{n}[/math][math]\text{V}_y(t)=y_1+(y_2-y_1)\,\frac{t}{n}[/math]Now that we have the equations for the points along both sides of the triangle, we will use them to create an equation that describe the lines tangent to the parabola.[math]\text{L}(t,x)=\frac{\text{V}_y(t)-\text{U}_y(t)}{\text{V}_x(t)-\text{U}_x(t)}\left(x-\text{U}_x(t)\right)+\text{U}_y(t)[/math]The following image illustrates these lines tracing out a parabolic curve.We can see that the parabolic curve is approximated by the points at the intersection of two consecutive lines. As the number of partitions approach infinity, the points of intersection converge to the points on the parabolic curve. By solving [math]\text{L}(t)=\text{L}(t+1)[/math], we can derive the [math]x[/math] and [math]y[/math] equations that define the points of intersection. Working the math we get:[math]x(t,n)=\frac{n^2\,x_0-n(2t+1)(x_0-x_1)+t(t+1)(x_0-2 x_1+x_2)}{n^2}[/math][math]y(t,n)=\frac{n^2\,y_0-n(2t+1)(y_0-y_1)+t(t+1)(y_0-2 y_1+y_2)}{n^2}[/math]Now that we have the parametric equation that defines the points of intersection, we can take the limit of this equation as the number of partitions [math]n[/math] approach infinity and arrive at the parametric equation that describes the parabolic curve. However, before we can do this, we'll need to redfine the parameter [math]t[/math] such that it approaches [math]n[/math] on the interval [0,1]. By redefining the parameter as [math]n\times t[/math], when [math]t=0[/math] we get back [math]0[/math] and when [math]t=1[/math] we get back [math]n[/math]. This allows us to parametetize the function using [math]n\times t[/math] where [math]\{t \in \mathbb{R} : 0\le t\le 1\}[/math] while covering the entire domain previously defined for [math]t[/math]: [math]\{t \in \mathbb{N} : 0\le t\le n\}[/math].[math]\lim_{n \to \infty}x(n\,t,n)=x_0-2\,x_0\,t+x_0\,t^2+2\,x_1\,t-2\,x_1\,t^2+x_2\,t^2[/math][math]\lim_{n \to \infty}y(n\,t,n)=y_0-2\,y_0\,t+y_0\,t^2+2\,y_1\,t-2\,y_1\,t^2+y_2\,t^2[/math]After we combine like terms and simplify the result, we finally arrive at the solution to the challenge.[math]P_x(t)=(x_0-2\,x_1+x_2)\,t^2-2(x_0-x_1)\,t+x_0[/math][math]P_y(t)=(y_0-2\,y_1+y_2)\,t^2-2(y_0-y_1)\,t+y_0[/math] where [math]\{t \in \mathbb{R} : 0\le t\le 1\}[/math]Verifying the ResultWe'll verify the solution by checking a known parabolic curve, [math]y=5-(1/5) x^2[/math]. We'll choose the points (-5,0) and (5,0) on the parabola to derive the third point of the triangle. The slope of the parabola at [math]x[/math] is [math]m=-(2/5)x[/math]. This allows us to use the point-slope form to find the lines that are tangent to the parabola at [math]x=-5[/math] and [math]x=5[/math]. Using these values we get:[math]T_0(x)=2(x+5)[/math][math]T_1(x)=-2(x-5)[/math]Solving for the point of intersection we get:[math]2(x+5)=-2(x-5)[/math][math]x=0[/math][math]y=2(0+5)=10[/math]Thus, the point in the middle, [math]P_1[/math], is located at (0,10). By using these points (-5,0), (0,10), and (5,0), we can check to see if the solution will produce the same parabolic curve. The following is a graph of both, [math]y=5-(1/5) x^2[/math] and the parametric equation using the specified points.By using a little algebra we can tranform the parametric equation back into a function and prove that both curves are equal. Basically, we use the parametric equation for the [math]x[/math] coordinate and solve for [math]t[/math] in terms of [math]x[/math]. Then, we substitute that result into the parametric equation for the [math]y[/math] coodinate. The result is a standard function [math]y=f(x)[/math], which is equal to our test parabola. Thus, proving that these curves are in fact parabolas.[math]x=((-5)-2\,(0)+(5))\,t^2-2((-5)-(0))\,t+(-5)=10\,t-5[/math][math]t=\frac{x+5}{10}[/math]Substitute [math]t[/math] into the parametric equation for the [math]y[/math] coordinates.[math]y=((0)-2\,(10)+(0))\,t^2-2((0)-(10))\,t+(0)=20\left(t-t^2\right)[/math][math]y=20\left(\frac{x+5}{10}-\frac{(x+5)^2}{10^2}\right)=5-\frac{1}{5}x^2[/math] Interesting Shapes and Curves If we reorder the vertices, then we can generate three different parabolic curves depending on the angles of the triangle and lengths of the sides. If we take each curve, we can glue them together at their endpoints and generate a smooth closed region. We can also glue the end points together to form smooth piecewise curves. However, I like this shape the best. As usual, I've attached the Mathematica 7 file for the challenge to this post. TenthChallenge.zip Edited November 29, 2013 by Daedalus 3 Share this post Link to post Share on other sites

Daedalus 329 Posted January 4, 2014 I always seem to see the patterns in the numbers, and while playing around with the result of this challenge, I managed to extend the solution beyond parabolic curves: [math]P_x(t)=(x_0-2\,x_1+x_2)\,t^2-2(x_0-x_1)\,t+x_0[/math][math]P_y(t)=(y_0-2\,y_1+y_2)\,t^2-2(y_0-y_1)\,t+y_0[/math] where [math]\{t \in \mathbb{R} : 0\le t\le 1\}[/math] If you look at the above result, you should notice some patterns that seem to be a recurring theme. As a bonus, I'll give anyone rep who can tell me what type of curve this new pattern entails. It's interesting, because I should've noticed this when I first worked the problem 0 Share this post Link to post Share on other sites

moth 128 Posted January 4, 2014 Is it a quadratic Bezier curve? 1 Share this post Link to post Share on other sites

Daedalus 329 Posted January 4, 2014 Is it a quadratic Bezier curve? Mainly just Bézier curves in general. The solution to the original challenge is as you say, quadratic Bézier curves. The general equation can be found here at Wikipedia. 0 Share this post Link to post Share on other sites

Commander 35 Posted December 15, 2014 (edited) I believe there can be many Parabolas and Ellipses which may fulfill the condition of being tangential at [X_{0, }Y_{0}] and [X_{1}_{, }Y_{1}] in the given triangle with [X_{2}_{, }Y_{2}] as its apex. ................. I have a power cut and will continue later >>>>>>>>>>>>>>> PS : After thinking over this problem for a while I wanted to give my views here and started writing the above. Only then I saw the preceding posts and found that it appears to be settled / solved and taken care of my points too. Therefore I have nothing more to give here just now Edited December 15, 2014 by Commander 0 Share this post Link to post Share on other sites