public static Point2D findDistancedPoint(double t,Point2D sp,Point2D c1,Point2D c2,Point2D ep){
  double d=1 - t;
  double dCube=d * d * d;
  double dSqr=d * d;
  double tCube=t * t * t;
  double tSqr=t * t;
  double xCoord=(dCube * sp.getX()) + (3 * t * dSqr* c1.getX()) + (3 * tSqr * d* c2.getX())+ (tCube * ep.getX());
  double yCoord=(dCube * sp.getY()) + (3 * t * dSqr* c1.getY()) + (3 * tSqr * d* c2.getY())+ (tCube * ep.getY());
  return new Point2D.Double(xCoord,yCoord);
}

public static Point2D findDistancedPoint ( double t , Point2D sp , Point2D c1 , Point2D c2 , Point2D ep ) { double d = 1 - t ; double dCube = d * d * d ; double dSqr = d * d ; double tCube = t * t * t ; double tSqr = t * t ; double xCoord = ( dCube * sp . getX ( ) ) + ( 3 * t * dSqr * c1 . getX ( ) ) + ( 3 * tSqr * d * c2 . getX ( ) ) + ( tCube * ep . getX ( ) ) ; double yCoord = ( dCube * sp . getY ( ) ) + ( 3 * t * dSqr * c1 . getY ( ) ) + ( 3 * tSqr * d * c2 . getY ( ) ) + ( tCube * ep . getY ( ) ) ; return new Point2D . Double ( xCoord , yCoord ) ; }
method used to find any point in given distance in cubic bezier curve
