def setUp(self): #generate a random distribution of points on the unit sphere (http://mathworld.wolfram.com/SpherePointPicking.html) #go for 5000 random points that are always the same thanks to a pinned down pnrg object (http://stackoverflow.com/a/5837352/2942522): self.prng = numpy.random.RandomState(117) #if I don't pin this down, then I can sometimes get pathological generator sets for which Voronoi diagrams are not available self.cartesian_coord_array = voronoi_utility.generate_random_array_spherical_generators(5000,1.0,self.prng) #and similarly for a generator data set using a much larger sphere radius: self.prng_2 = numpy.random.RandomState(556) self.large_sphere_radius = 87.0 self.cartesian_coord_array_large_radius = voronoi_utility.generate_random_array_spherical_generators(5000,self.large_sphere_radius,self.prng_2) self.spherical_triangle_coordinate_array = numpy.array([[0,0,1],[0,1,0],[1,0,0]]) #3 points on a unit sphere self.spherical_polygon_4_vertices_coord_array = numpy.array([[0,0,1],[0,1,0],[1,0,0],[0,-1,0]]) #4 points on a unit sphere self.unit_sphere_surface_area = 4 * math.pi
def setUp(self): #generate a random distribution of points on the unit sphere (http://mathworld.wolfram.com/SpherePointPicking.html) #go for 5000 random points that are always the same thanks to a pinned down pnrg object (http://stackoverflow.com/a/5837352/2942522): self.prng = numpy.random.RandomState( 117 ) #if I don't pin this down, then I can sometimes get pathological generator sets for which Voronoi diagrams are not available self.cartesian_coord_array = voronoi_utility.generate_random_array_spherical_generators( 5000, 1.0, self.prng) #and similarly for a generator data set using a much larger sphere radius: self.prng_2 = numpy.random.RandomState(556) self.large_sphere_radius = 87.0 self.cartesian_coord_array_large_radius = voronoi_utility.generate_random_array_spherical_generators( 5000, self.large_sphere_radius, self.prng_2) self.spherical_triangle_coordinate_array = numpy.array( [[0, 0, 1], [0, 1, 0], [1, 0, 0]]) #3 points on a unit sphere self.spherical_polygon_4_vertices_coord_array = numpy.array( [[0, 0, 1], [0, 1, 0], [1, 0, 0], [0, -1, 0]]) #4 points on a unit sphere self.unit_sphere_surface_area = 4 * math.pi
def setUp(self): self.test_sphere_radius = 1.0 self.num_generators = 100 self.prng = numpy.random.RandomState(117) self.random_spherical_coord_array = voronoi_utility.generate_random_array_spherical_generators( self.num_generators, self.test_sphere_radius, self.prng)
def setUp(self): self.test_sphere_radius = 1.0 self.num_generators = 100 self.prng = numpy.random.RandomState(117) self.random_spherical_coord_array = voronoi_utility.generate_random_array_spherical_generators(self.num_generators, self.test_sphere_radius, self.prng)