Skip to content

Instantly share code, notes, and snippets.

@zmjjmz
Created March 29, 2015 21:32
Show Gist options
  • Save zmjjmz/7c2bebec5a01b08e7fee to your computer and use it in GitHub Desktop.
Save zmjjmz/7c2bebec5a01b08e7fee to your computer and use it in GitHub Desktop.
for line in norm_lines:
a = np.cos(line[1])
b = np.sin(line[1])
x0 = a*line[0]
y0 = b*line[0]
#print(a, b)
#print(line[1]*180/np.pi)
#line_func = lambda t: (x0 + b*t, y0 - a*t)
#norm_line_seg = np.hstack([line_func(segment_length), line_func(-1*segment_length)])
norm_line_seg = [x0 - segment_length*b,
y0 + segment_length*a,
x0 + segment_length*b,
y0 - segment_length*a]
norm_line_segs.append(norm_line_seg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment