n-sphere计算方法-
生活随笔
收集整理的這篇文章主要介紹了
n-sphere计算方法-
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
摘自:https://en.wikipedia.org/wiki/N-sphere
角度的計算方法,可以用如下Python代碼實現
def angle(self, n): # <2>r = math.sqrt(sum(x * x for x in self[n:]))a = math.atan2(r, self[n-1])if (n == len(self) - 1) and (self[-1] < 0):return math.pi * 2 - aelse:return adef angles(self): # <3>return (self.angle(n) for n in range(1, len(self)))總結
以上是生活随笔為你收集整理的n-sphere计算方法-的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 3维旋转的3种表示方法之间的关系
- 下一篇: matplotlib中plot的颜色