File: code_block0.py

package info (click to toggle)
python-traitsui 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 13,292 kB
  • sloc: python: 39,867; makefile: 120; sh: 5
file content (15 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from numpy import cos, sin

class Point(object):
    """ 3D Points objects """
    x = 0.
    y = 0.
    z = 0.

    def rotate_z(self, theta):
        """ rotate the point around the Z axis """
        xtemp =  cos(theta) * self.x + sin(theta) * self.y
        ytemp = -sin(theta) * self.x + cos(theta) * self.y
        self.x = xtemp
        self.y = ytemp