Skip to content

Instantly share code, notes, and snippets.

@wenbert
Created November 4, 2010 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wenbert/662337 to your computer and use it in GitHub Desktop.
Save wenbert/662337 to your computer and use it in GitHub Desktop.
tolerance
tolerance = abs(float(tolerance))
if(tolerance > 0):
#get the difference of every bearing change
#if difference is within tolerance, print
#otherwise, ignore
diff = float(previous_bearing) - float(bearing)
#print abs(diff),tolerance
if(float(previous_bearing) != float(bearing)):
if(abs(diff) <= tolerance):
#print ("%d,%s,%s,%s\n" % (i,easting,northing,bearing)),
print abs(diff),tolerance
new_file.write("%f,%f,%s\n" % (abs(diff),tolerance,bearing))
#new_file.write("%d,%s,%s,%s\n" % (i,easting,northing,bearing))
elif(float(previous_bearing) != float(bearing)):
#print ("%d,%s,%s,%s\n" % (i,easting,northing,bearing)),
new_file.write("%d,%s,%s,%s\n" % (i,easting,northing,bearing))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment