您的代码正在生成随机分布法线的飞机.他们只是不这样看,因为z尺度比x和y尺度大得多.
您可以通过生成点来生成更好的图像
均匀分布在飞机上.这样做,参数化飞机
新坐标(u,v),然后在均匀间隔的网格上对平面进行采样
(u,v)分.然后将(u,v)点转换为(x,y,z) – 点中的点.
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
import itertools as IT
def points_on_sphere(dim, N, norm=np.random.normal):
"""
http://en.wikipedia.org/wiki/N-sphere#Generating_random_points
"""
normal_deviates = norm(size=(N, dim))
radius = np.sqrt((normal_deviates ** 2).sum(axis=0))
points = normal_deviates / radius
return points
# Number of hyperplanes
n = 10
# Dimension of space
d = 3
fig, ax = plt.subplots(subplot_kw=dict(projection='3d'))
points = points_on_sphere(n, d).T
uu, v