"Melissa" wrote in message <email@example.com>... > Hey! I'm trying to model a brachistochrone curve given a start and end point(randomly chosen). I'm not sure how to implement the parametric equations of the model with just two points to start off. Any suggestions?
Let A=(x1,y1) and B=(x2,y2) be the two randomly chosen points (where the points are ordered such that y2>y1). Then the parametric Brachistochrone curve between the two points is given by x(t)=x2+R*(t-sin(t)) y(t)=y2+R*(cos(t)-1). The other condition the curve has to fulfill is that it passes through A. Thus x1=x2+R*(t*-sin(t*)) y1=y2+R*(cos(t*)-1) for a certain value t*. This is a system of two equations in two unknowns (R and t*). Once you have determined R and t*, the curve (x(t),y(t)) for t in [0:t*] is the brachistochrone curve you want to determine. You may solve the two-equation-system using MATLAB's fsolve or you may eliminate R and solve the equation (x1-x2)/(y1-y2)=(t-sin(t))/(cos(t)-1) for t* using MATLAB's fzero.