#NEWLINE# def drawSamples( self , nsamples ) : #NEWLINE# #INDENT# import matplotlib.pyplot as plt #NEWLINE# plt . figure ( 1 ) #NEWLINE# plt . clf ( ) #NEWLINE# plt . hold ( True ) #NEWLINE# k = ConvexHull ( self . bot_pts . T ) . vertices #NEWLINE# k = np . hstack ( ( k , k [ 0 ] ) ) #NEWLINE# n = self . planar_polyhedron . generators . shape [ 0 ] #NEWLINE# plt . plot ( self . planar_polyhedron . generators . T [ ( 0 , ( range ( n ) + [ 0 ] ) ) ] , self . planar_polyhedron . generators . T [ ( 1 , ( range ( n ) + [ 0 ] ) ) ] , 'r.-' ) #NEWLINE# samples = sample_convex_polytope ( self . c_space_polyhedron . A , self . c_space_polyhedron . b , 500 ) #NEWLINE# for i in range ( samples . shape [ 1 ] ) : #NEWLINE# #INDENT# R = np . array ( [ [ np . cos ( samples [ ( 2 , i ) ] ) , ( - np . sin ( samples [ ( 2 , i ) ] ) ) ] , [ np . sin ( samples [ ( 2 , i ) ] ) , np . cos ( samples [ ( 2 , i ) ] ) ] ] ) #NEWLINE# V = R . dot ( self . bot_pts [ : , k ] ) #NEWLINE# V = ( n + samples [ : 2 , i ] . reshape ( ( 2 , 1 ) ) ) #NEWLINE# plt . plot ( V [ 0 , : ] , V [ 1 , : ] , 'k-' ) #NEWLINE# #UNINDENT# plt . show ( )