Calculating your angle using just x value seem strange, try this:
angle = Math.atan( (startY - endY) / (startX - endX) ); // in rad
This will give you the angle in radian.
For calculating the velocity you must have a timing variable between the start and the end touch. You can use getTimer()
to get beginTime
and endTime
in your functions onTouchBegin
and onTouchEnd
respectively.
After that you just have to calculate velocity with distance and time.
distance = Math.sqrt( ((startX - endX)*(startX - endX)) / ((startY - endY)*(startY - endY)) );
velocity = distance / (endTime-beginTime); // in pixel/ms
Hope that helps ;)