Skip to content

Instantly share code, notes, and snippets.

@zmjjmz
Created March 29, 2015 04:03
Show Gist options
  • Save zmjjmz/a2cba570864142a08bbd to your computer and use it in GitHub Desktop.
Save zmjjmz/a2cba570864142a08bbd to your computer and use it in GitHub Desktop.
a = np.cos(norm_lines[:,1])
b = np.sin(norm_lines[:,1])
x0 = a*norm_lines[:,0]
y0 = b*norm_lines[:,0]
norm_line_segs = np.vstack([x0-segment_length*b,
y0+segment_length*a,
x0+segment_length*b,
y0-segment_length*a]).T
norm_line_segs = np.vectorize(int)(norm_line_segs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment