Simplified Algorithm of Moving Object Trajectory Based on Interval Floating
Algorithm 1
Simplified Algorithm of Moving Object Trajectory Based on Interval Floating (STIF).
Input: The starting point ,,, Angle deviation of current point , Cumulative angular deviation of current point , Upper interval , Lower interval , Current maximum and minimum angle deviation ,, Float limit
Output: Simplified trajectory
for (int i = 1; i < P.size() − 1; i++){
if ( < )
= ;
if ( > )
=
//If the angle deviation of the current point is greater than
if (Math.abs() > ){
add (P.get(ii));
= 0;
flag = 0;
;//“Zero adjustment” in the upper section”
; //“Zero adjustment” in the lower interval
= 0;
= 0;
}
if (Math.abs()> ){
//The upper interval meets the floating condition
if ( > && < && flag == 0){
//Float in the lower interval
= ;
//Float up the upper interval
= + ;
//Calculate the subsequent points after the interval has floated once. When //the simplified condition is reached again, “zero”
flag = 1;
} else if( < && > && flag = = 0){
//The lower interval meets the floating condition
//Float in the upper interval
= ;
//Float down in the lower interval
= + ;
flag = 1;
}else if(flag = = 1){
//Already floated once, cannot float again
add (P.get(ii));
= 0;
flag = 0;
= ; //“Zero adjustment” in the upper section
= -;//“Zero adjustment” in the lower interval
= 0;
= 0;
} else if(Math.abs () >) { add(P.get(ii));
= 0;
flag = 0;
= ;//“Zero adjustment” in the upper section
= −; //“Zero adjustment” in the lower interval
= 0;
= 0;
}
if ( < || > ){
add (P.get(ii));
= 0;
flag = 0;
= ; //“Zero adjustment” in the upper section
= −; //“Zero adjustment” in the lower interval
= 0;
= 0;
}
} //if (Math.abs(deviation) >error_t)
}
add (P.get(P.size()-1)); //The last point is added