So to define the problem in terms of variables:
1. Start with any point x1,y1
2. Arrow can fly to any endpoint, call it x2,y2
3. Now pretend you draw a line from x1,y1 to x2,y2
4. Now take the middle of the line and move it away a distance "h", end points don't move.
5. I need an arc, starting at x1,y1 and ending at x2,y2, with a height of h... make sense?
I need an efficient algorithm for calculating this, Here's how I'm drawing a straight line from x1, y1 to x2, y2
int x1,y1,x2,y2,h;
float Dist, Angle;
//---------------------------------------------------------------------------------------------------------------
// These can be any combination of numbers
x1=90; y1=90; x2=300; y2=295, h=50;
Graphics.DrawLine(x1, y1, x2, y2, Red, *g2); //From my Graphics Library
Dist=sqrt(float(x2-x1)*float(x2-x1)+float(y2-y1)+float(y2-y1));
Angle=atan(float(y2-y1)/float(x2-x1) ) ;
for(i=0;i<Dist;i++)
{
Graphics.SetPixel(int(x1+i), int(y1+i*tan(Angle)), RGB(255, i, i), *g2);
}

I'd like to have little to no trig functions like sine or tan if possible...
All my men are in a 2d iso view, so I don't think gravity formula's will work well as the arc would come out weird, if everything was 2d then gravity would work fine...
I was thinking of using the equation of an ellipse and rotating it but I think it'll look to bulgy or rounded on the ends, plus it would use lots of time consuming eqn's with sqrt's....
Hope that made sense?
Any help would be appreciate...
Vanz
Edited by rhuala, 21 August 2012 - 12:50 AM.






