| Algorithm 2: Pseudo-code of computing the relation between the old and new reference lines. | |
| 1: | If flag is high |
| 2: | calculate the unit vector of the old 1st reference line |
| 3: | calculate the unit vector of the new 1st reference line |
| 4: | compute the intersected angle between the two vectors |
| 5: | compute the cross product of the two vectors |
| 6: | If the 3rd component of the cross-product result is less than zero |
| 7: | angle = −angle |
| 8: | End if |
| 9: | End if |