Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

fibonacci sphere python

from numpy import pi, cos, sin, arccos, arange
import mpl_toolkits.mplot3d
import matplotlib.pyplot as pp

num_pts = 1000
indices = arange(0, num_pts, dtype=float) + 0.5

phi = arccos(1 - 2*indices/num_pts)
theta = pi * (1 + 5**0.5) * indices

x, y, z = cos(theta) * sin(phi), sin(theta) * sin(phi), cos(phi);

pp.figure().add_subplot(111, projection='3d').scatter(x, y, z);
pp.show()
Comment

PREVIOUS NEXT
Code Example
Python :: modules django 
Python :: python 2nd order ode 
Python :: dice throw program in python 
Python :: consider a string note: "welcome" statment will rais error 
Python :: regression avec sklearn best 
Python :: insertar en una lista anidada python 
Python :: dataframe from function 
Python :: foreign key on delete arguments 
Python :: ticklabels are not centered heatmap 
Python :: python seeded random 
Python :: where are dictd dictionaries 
Python :: image processing and resizing with python 
Python :: qcombobox remove all items 
Python :: how to shorten turtle. to t. 
Python :: populate initial data for django simple history 
Python :: pandas data frame from part of excel easy 
Python :: Print all day-dates between two dates [duplicate] 
Python :: replace substrings to float 
Python :: how to iterate a dictionary with minimum value in python 
Python :: django celery email 
Python :: django create superuser with first_name 
Python :: add js file in web.assets_backend 
Python :: pandas subtract two columns 
Python :: how to sort a list of lists in reverse order using the first parameter in python 
Python :: py decorateur 
Python :: Python Tkinter Message Widget Syntax 
Python :: Copy an Object in Python using = operator 
Python :: getroot xml python 
Python :: How to swapcase of string in python 
Python :: Get First From Table Django 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =