コード例 #1
0
ファイル: body.py プロジェクト: diegor2/FGAme
    def orientation(self, theta=0.0):
        '''Retorna um vetor unitário na direção em que o objeto está orientado.
        Pode aplicar um ângulo adicional a este vetor fornecendo o parâmetro
        _theta.'''

        theta += self._theta
        return Vec2(cos(theta), sin(theta))
コード例 #2
0
ファイル: poly.py プロジェクト: gutioliveira/FGAme
 def _vertices(self, N, pos):
     length = self.length
     alpha = pi / N
     theta = 2 * alpha
     b = length / (2 * sin(alpha))
     P0 = Vec2(b, 0)
     pos = Vec2(*pos)
     return [(P0.rotate(n * theta)) + pos for n in range(N)]
コード例 #3
0
ファイル: poly.py プロジェクト: arpit-dhankar/pythonProject
 def _vertices(self, N, pos):
     length = self.length
     alpha = pi / N
     theta = 2 * alpha
     b = length / (2 * sin(alpha))
     P0 = Vec2(b, 0)
     pos = Vec2(*pos)
     return [(P0.rotate(n * theta)) + pos for n in range(N)]